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)

models.py (18.7 KB ) - added by tkolar 14 years ago.
Version of models.py that sets django.contrib.auth.models.SiteProfileNotAvailable.silent_variable_failure=True
svft.diff (2.9 KB ) - added by tkolar 14 years ago.
Patch that implements the proposed change, test included

Download all attachments as: .zip

Change History (12)

by tkolar, 14 years ago

Attachment: models.py added

Version of models.py that sets django.contrib.auth.models.SiteProfileNotAvailable.silent_variable_failure=True

comment:1 by tkolar, 14 years ago

Sorry for the dead link in the file description - no idea how that happened.

comment:2 by Russell Keith-Magee, 14 years ago

Has patch: set
Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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 tkolar, 14 years ago

Attachment: svft.diff added

Patch that implements the proposed change, test included

comment:3 by tkolar, 14 years ago

Cc: tkolar added

Done ;)

comment:4 by tkolar, 14 years ago

Needs tests: unset
Owner: changed from nobody to tkolar
Patch needs improvement: unset
Status: newassigned

comment:5 by James Addison, 14 years ago

Severity: Normal
Type: Bug

comment:6 by tkolar, 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 tkolar, 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:8 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 by Ludovic Delaveau, 12 years ago

Cc: ldelaveau@… added
Triage Stage: AcceptedReady 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 Florian Apolloner, 12 years ago

Resolution: wontfix
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top