[traceback][stage] QuerySet.dates() raises an error in /admin UserProfiles

VERIFIED FIXED

Status

Participation Infrastructure
Phonebook
VERIFIED FIXED
4 years ago
3 years ago

People

(Reporter: nemo, Assigned: nemo)

Tracking

Details

(Whiteboard: [kb=1632730] )

(Assignee)

Description

4 years ago
File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-2.18.1.15/newrelic/hooks/framework_django.py", line 492, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/options.py", line 465, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/sites.py", line 198, in inner
    return view(request, *args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/options.py", line 1339, in changelist_view
    self)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/views/main.py", line 108, in __init__
    self.queryset = self.get_queryset(request)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/views/main.py", line 359, in get_queryset
    filters_use_distinct) = self.get_filters(request)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/views/main.py", line 166, in get_filters
    self.model, self.model_admin)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/contrib/admin/filters.py", line 69, in __init__
    lookup_choices = self.lookups(request, model_admin)

  File "/data/www/mozillians.allizom.org/mozillians/mozillians/users/admin.py", line 143, in lookups
    User.objects.dates('date_joined', 'year'))

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/manager.py", line 139, in dates
    return self.get_queryset().dates(*args, **kwargs)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/query.py", line 550, in dates
    _field_name=field_name, _kind=kind, _order=order)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/query.py", line 852, in _clone
    c._setup_query()

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/query.py", line 1116, in _setup_query
    self.query.add_select(self._field_name, self._kind, self._order)

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/sql/subqueries.py", line 242, in add_select
    self._check_field(field)                # overridden in DateTimeQuery

  File "/data/www/mozillians.allizom.org/mozillians/vendor/src/django/django/db/models/sql/subqueries.py", line 258, in _check_field
    "%r is a DateTimeField, not a DateField." % field.name

AssertionError: 'date_joined' is a DateTimeField, not a DateField.
(Assignee)

Comment 1

4 years ago
We should use QuerySet.datetimes() instead. That also requires MySQL timezone support.
Assignee: nobody → jgiannelos
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [kb=1632730]
(Assignee)

Updated

4 years ago
Depends on: 1122531

Comment 3

4 years ago
Commit pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/eec173f53c8346e010bbec32f4c440c28431b874
[Fix bug 1122518] Use QuerySet.datetimes() instead of QuerySet.dates().

Updated

4 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
Version: other → next
(Assignee)

Comment 4

3 years ago
Verified on stage.
Status: RESOLVED → VERIFIED
(Assignee)

Updated

3 years ago
Version: next → 2015-1.4
You need to log in before you can comment on or make changes to this bug.