Skip to content

Custom user-mobile field #113

@nate-sha

Description

@nate-sha

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

  • PASSWORDLESS_USER_MOBILE_FIELD_NAME: 'profile.mobile'
  • PASSWORDLESS_USER_MOBILE_FIELD_NAME: 'Profile.mobile'
  • PASSWORDLESS_USER_MOBILE_FIELD_NAME: 'User.profile.mobile'

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions