Replies: 5 comments
-
I am not sure I fully understand the purpose here. There is already a related model that stores the email -- |
Beta Was this translation helpful? Give feedback.
-
Hi again, Yes, those models are the same. However, in scenarios like my codebase, which already utilizes a For example, considering the The SQL query from line q_dict = {app_settings.USER_MODEL_EMAIL_FIELD + "__iexact": email}
user_qs = User.objects.filter(**q_dict) The However, the line user_email = getattr(user, app_settings.USER_MODEL_EMAIL_FIELD) Cannot work, as the The proposed solution addresses this scenario by allowing Perhaps I am mistaken, but after reviewing the codebase, it's the only viable solution I found for integrating complex |
Beta Was this translation helpful? Give feedback.
-
That line you are referring to:
That is preceded by a I don't quite understand the purpose of your |
Beta Was this translation helpful? Give feedback.
-
We have a well-established User model in our Django application that includes a We integrated I propose a convenient method to support this migration and suggest using Do you think it's a security issue to do it this way ? |
Beta Was this translation helpful? Give feedback.
-
We're planning to use |
Beta Was this translation helpful? Give feedback.
-
Hi,
I wonder if you are interessting for this PR: acuD1#1.
Handle the case where the email field is not directly on the user model, but instead on a related model. This is the case when using a custom user model with a separate email model.
The default is to use the email field directly on the user model specified by
USER_MODEL_EMAIL_FIELD
.For example:
This would be used in conjunction with:
Assuming the user model has a related model called
user_email
with a field calledemail
.Beta Was this translation helpful? Give feedback.
All reactions