#19218: Can't use get_user_model() when connect to signal sender
-------------------------------------+-------------------------------------
     Reporter:  kunitoki@…           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.auth         |                  Version:
     Severity:  Normal               |  1.5-alpha-1
     Keywords:  auth user            |               Resolution:  invalid
  get_user_model signals connect     |             Triage Stage:
  receiver                           |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by anonymous):

 My settings file is correct, the problem is that you can't call
 get_user_model() at global scope in the same models.py that define your
 AUTH_USER_MODEL (especially when assigning to the sender argument in
 signal registration).

 Probably this is normal python precedence behaviour (get_user_model try to
 access a model that isn't registered to django models as the current
 module has not finished parsing), or eventually get_user_model could be
 lazy instead...

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19218#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to