Opened 4 years ago

Closed 5 months ago

#14664 closed New feature (fixed)

MiddlewareNotUsed should display a warning

Reported by: teserak Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords: sprintdec2010
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

MiddlewareNotUsed should display a warning.
Warning could contain middleware_path and user message if it's defined.

For example:

MiddlewareNotUsed("Online users middleware supports only database session engines."))

display:

MiddlewareWarning: users.middleware.OnlineUsers. Online users middleware supports only database session engines.

Change History (7)

comment:1 Changed 4 years ago by dariog

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

when do you think it would be necessary?
It would log the message with DEBUG=TRUE or DEBUG=FALSE?

comment:2 Changed 4 years ago by julien

  • Keywords sprintdec2010 added
  • milestone 1.3 deleted
  • Triage Stage changed from Unreviewed to Accepted

This would be reasonable if DEBUG=True. This is a feature request, so removing from the 1.3 milestone which is now focused on bug fixing.

comment:3 Changed 4 years ago by jaddison

  • Severity set to Normal
  • Type set to New feature

comment:4 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 6 months ago by berkerpeksag

  • Has patch set
  • Version changed from 1.2 to master

I've logged a warning instead of adding a new warning class to be consistent with the rest of the file.

https://github.com/django/django/pull/3486

comment:7 Changed 5 months ago by Tim Graham <timograham@…>

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

In 093e6c68b9b5afdf1f059a2321affc999763e919:

Fixed #14664 -- Logged a warning if MiddlewareNotUsed is raised in DEBUG mode.

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