Re: [Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
+--
 Reporter:  mpecov@…|Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  contrib.admin   |  Version:  1.6
 Severity:  Normal  |   Resolution:  invalid
 Keywords:  admin template  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by charettes):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 As pointed out by Keryn, the documentation '''clearly''' states that you
 must implement this method when specifying a custom `User` model.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.3bd84bb1b3f6188386430dbf9e714c10%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
+--
 Reporter:  mpecov@…|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.6
 Severity:  Normal  |   Resolution:
 Keywords:  admin template  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--

Comment (by Keryn Knight ):

 This is correct behaviour -- the reason you're seeing it crash is, I
 believe, because your custom user implementation is incomplete, see
 [https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#specifying-a
 -custom-user-model the "specifying a custom user model" documentation],
 which outlines the attributes (methods/properties) that need to exist for
 a complete implementation, one of which is `get_short_name`, which is set
 to raise a `NotImplementedError` if inheriting from `AbstractBaseUser`.
 There is, additionally, an
 [https://docs.djangoproject.com/en/1.6/ref/contrib/auth/ API reference for
 the default auth implementation], which enumerates an overview of what is
 expected.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.31b42bbeb817ba26fba37f12fb6ffd84%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
+--
 Reporter:  mpecov@…|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.6
 Severity:  Normal  |   Resolution:
 Keywords:  admin template  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--

Comment (by mpecov@…):

 the function get_short_name is crashing the whole template with
 NotImplementedError

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.90b03bd3df34c6bbb227fc163baf7783%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
+--
 Reporter:  mpecov@…|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.6
 Severity:  Normal  |   Resolution:
 Keywords:  admin template  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--

Comment (by anonymous):

 yup, but try to put USERNAME_FIELD = 'id' there and see what happens

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.5dc8f7d82a3d5af6cb41bc08dd484a50%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
+--
 Reporter:  mpecov@…|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.6
 Severity:  Normal  |   Resolution:
 Keywords:  admin template  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by Siecje):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 When you subclass AbstractBaseUser you need to specify a field to be used
 as the 'username'

 USERNAME_FIELD = 'email'

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.e5e4a9a3f9f9fd72fa2c46627ff541c2%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Django] #21709: Admin template bug if there is no username field (custom user)

2013-12-30 Thread Django
#21709: Admin template bug if there is no username field (custom user)
---+
 Reporter:  mpecov@…   |  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.6
 Severity:  Normal |   Keywords:  admin template
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  1  |  UI/UX:  0
---+
 Today is pretty normal to expect that someone will use a custom user model
 without the username field because he wants to have a simple login via
 email form.

 If you exclude the username field from the user model, the base.html in
 the contrib.admin will crash because of this line:
 {{{
  {% firstof user.get_short_name user.get_username %}.
 }}}
 So, my suggestion is to make a simple check
 {{{ {% if user.username %} }}}
 in this line, and avoid the potential problems

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.8adb49ff8edb68e68af681a2eba1661b%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.