Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#12575 closed (fixed)

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

Reported by: SmileyChris Owned by: SmileyChris
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 SmileyChris 5 years ago.
patch with docs and fixed tests (to reflect api changes)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to SmileyChris
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 5 years ago by SmileyChris

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 5 years ago by SmileyChris

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

comment:3 Changed 5 years ago by SmileyChris

  • Has patch set
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:4 Changed 5 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [12207]

comment:5 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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