Maik Hoepfel
5d0587e5df
Fix regression with PhoneNumberMixin
Unfortunately, we subtly altered logic when trying to make
PhoneNumberMixin more reusable. d1281ce made considering the country in
cleaned_data the lowest priority instead of the highest.
This commit fixes that by considering the data from cleaned_data first.
I also realised we should never consider the fields queryset -- either
there is a valid selection and it'll be in cleaned_data, or there's a
good reason we shouldn't use it. This commit also now only considers the
form instance if we're sure there's no country field in the form.
Closes #1503.
Ping @mbertheau.