Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#12575 closed (fixed)

Create a better interface for getting/setting the effective level of contrib.messages

Reported by: Chris Beaven Owned by: Chris Beaven
Component: Contrib apps Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

As Jeremy Dunck reported, the API to set the effective messaging level is awkward:

# Change the messages level to ensure the debug message is added. 
messages.get_messages(request).level = messages.DEBUG 

The general consensus seems to be having two methods called 'get_level' and 'set_level'.

Attachments (1)

12575.diff (7.1 KB) - added by Chris Beaven 7 years ago.
patch with docs and fixed tests (to reflect api changes)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by Chris Beaven

Owner: changed from nobody to Chris Beaven
Status: newassigned

comment:2 Changed 7 years ago by Chris Beaven

In fact, adding some tests I see that the current API is broken (since it's now proxied as a list, which doesn't have a level property)

Changed 7 years ago by Chris Beaven

Attachment: 12575.diff added

patch with docs and fixed tests (to reflect api changes)

comment:3 Changed 7 years ago by Chris Beaven

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:4 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: assignedclosed

Fixed in [12207]

comment:5 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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