Opened 14 years ago
Closed 12 years ago
#15098 closed Bug (wontfix)
SiteProfileNotAvailable needs silent_variable_failure=True
Reported by: | tkolar | Owned by: | tkolar |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | SiteProfileNotAvailable silent_variable_failure |
Cc: | tkolar, ldelaveau@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
This makes sense in the context of #15097. If I understand this correctly, the problem from #15097 should exist in the dev version (because of the behavior detailed in the paragraph directly above http://docs.djangoproject.com/en/dev/ref/templates/api/#how-invalid-variables-are-handled). My guess is that this is exactly the type of thing that silent_variable_failure
is there for, and SiteProfileNotAvailable
does not have silent_variable_failure=True
in SVN. I have attached a models.py
that fixes this.
Attachments (2)
Change History (12)
by , 14 years ago
comment:1 by , 14 years ago
Sorry for the dead link in the file description - no idea how that happened.
comment:2 by , 14 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
Seems like a reasonable suggestion. I can't think of any reason that get_profile should raise an exception during template rendering.
For future reference, please upload patches, rather than full files. Patches should also include tests to validate that the change does what it says.
by , 14 years ago
Patch that implements the proposed change, test included
comment:4 by , 14 years ago
Needs tests: | unset |
---|---|
Owner: | changed from | to
Patch needs improvement: | unset |
Status: | new → assigned |
comment:5 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:6 by , 13 years ago
Easy pickings: | unset |
---|
Should the severity of this bug really be "normal"? If it isn't fixed, every template that does {{ user.get_profile.<some_field> }}
will be broken if users do not necessarily have a profile. Besides, there is no other reliable way to get profile fields at all in the given situation without changing the view. Also, my patch fixes it already.
comment:7 by , 13 years ago
Easy pickings: | set |
---|
And since all that anyone has to do with this patch to implement it is apply it, I set "easy pickings".
comment:9 by , 12 years ago
Cc: | added |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Bumping the ticket, looks ready for checkin with respect to the previous discussion.
If needed, pull request is at https://github.com/django/django/pull/449
comment:10 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Django 1.5 will ship with a new method to add data to the user model and as such the current AUTH_PROFILE_MODULE is deprecated and will go away (including stuff like get_profile). As a result of the deprecation we won't fix any non critical bugs. Sry that we couldn't get this in earlier.
Version of models.py that sets django.contrib.auth.models.SiteProfileNotAvailable.silent_variable_failure=True