You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is most likely not an issue rather than a problem that I could not find an answer for, thank you in advance :-)
Error: django.core.exceptions.FieldError: Cannot resolve keyword 'mobile' into field
Setup: The user mobile field lives in a separate "Profile" model that has an OneToOne relation with the User model, to get the "mobile" values, I usually do User.profile.mobile; I am currently using this to return the authenticated user's full profile.
I tried the following values for PASSWORDLESS_USER_MOBILE_FIELD_NAME and it did not work
Do I need to override/use my own "send_sms_with_callback_token"
to_number = getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME)
if to_number.class.name == 'PhoneNumber':
to_number = to_number.str()
Thanks
The text was updated successfully, but these errors were encountered:
I think it's a bug. I checked the code and this line causing the error.
ifapi_settings.PASSWORDLESS_REGISTER_NEW_USERSisTrue:
# If new aliases should register new users.try:
user=User.objects.get(**{self.alias_type+'__iexact': alias}) # it looks for alias_type for mobile field that is always 'mobile'# same with email. Always 'email' checkexceptUser.DoesNotExist:
user=User.objects.create(**{self.alias_type: alias})
user.set_unusable_password()
user.save()
else:
# If new aliases should not register new users.try:
user=User.objects.get(**{self.alias_type+'__iexact': alias})
exceptUser.DoesNotExist:
user=None
Hi,
This is most likely not an issue rather than a problem that I could not find an answer for, thank you in advance :-)
Error: django.core.exceptions.FieldError: Cannot resolve keyword 'mobile' into field
Setup: The user mobile field lives in a separate "Profile" model that has an OneToOne relation with the User model, to get the "mobile" values, I usually do User.profile.mobile; I am currently using this to return the authenticated user's full profile.
I tried the following values for PASSWORDLESS_USER_MOBILE_FIELD_NAME and it did not work
Do I need to override/use my own "send_sms_with_callback_token"
to_number = getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME)
if to_number.class.name == 'PhoneNumber':
to_number = to_number.str()
Thanks
The text was updated successfully, but these errors were encountered: