#25845: False timezone offset warnings in admin if a custom base template 
doesn't
set data-admin-utc-offset
-------------------------------+--------------------
     Reporter:  Strayer        |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  contrib.admin  |    Version:  1.9
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Django 1.9 introduced a new data attribute on the body tag in the Django
 admin base template:
 
https://github.com/django/django/commit/8eeb566aca33600d272dee5fba59c3445b5b8163

 This attribute is read in JavaScript with getAttribute() and checked on
 !== undefined to determine if it is set:
 
https://github.com/django/django/commit/8eeb566aca33600d272dee5fba59c3445b5b8163
 #diff-cb2d960617da7bad9ba5ed3366931159R22

 This worked with the previous code, but getAttribute() returns null or "",
 which never equals undefined. Because of this the following code will run,
 calculating false offsets between browser time and server time, causing
 false warnings to appear in the admin date widgets.

 More info on getAttribute():
 https://developer.mozilla.org/de/docs/Web/API/Element/getAttribute#Notes

 I noticed this after upgrading to Django 1.9 while using django-suit,
 which is missing the attribute on body at the moment:
 https://github.com/darklow/django-suit/issues/449

--
Ticket URL: <https://code.djangoproject.com/ticket/25845>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.1448f467de40fd3ac177e26ad15dc71c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to