#29782: Better error message when filtering users with AnonymousUser
-------------------------------------+-------------------------------------
Reporter: Sveder | Owner: nobody
Type: | Status: new
Uncategorized |
Component: Database | Version: 2.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
When trying to filter a model with User ForeignKey on AnonymousUser, we
get a cryptic:
`Exception Value: int() argument must be a string or a number, not
'AnonymousUser'`
For example:
https://stackoverflow.com/questions/3439709/how-to-cater-for-
anonymoususer-when-filtering-based-on-user
I think this deserves a better error message, for example something like:
`ValueError("Can't filter User field with AnonymousUser")`.
--
Ticket URL: <https://code.djangoproject.com/ticket/29782>
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/049.7ab2ac5f0e9d5b0faaac5fef503564a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.