Opened 3 months ago

Closed 8 weeks ago

Last modified 8 weeks ago

#30318 closed Bug (fixed)

Add new system check message when custom error handler 'path.to.view' cannot be imported

Reported by: Alasdair Nicol Owned by: Alasdair Nicol
Component: Core (System checks) Version: 2.2
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alasdair Nicol)

#29642 added checks for the signatures of custom error handlers.

When the 'path.to.view' cannot be imported, it raises ModuleNotFoundError or ViewDoesNotExist, as seen in this Stack Overflow question:

https://stackoverflow.com/q/55481810/113962

I suggest we catch the exception, and add another check code, e.g.

* **urls.E008**: The custom ``handlerXXX`` view ``'path.to.view'`` cannot be imported.

Change History (9)

comment:1 Changed 3 months ago by Alasdair Nicol

Owner: changed from nobody to Alasdair Nicol
Status: newassigned

comment:2 Changed 3 months ago by Carlton Gibson

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Hi Alasdair,

Thanks for the report, and the effort on StackOverflow. I'm happy to take this as improvement on the system check for 2.2.1. (Yes, catching an incorrect path is probably worthwhile.)

comment:3 Changed 3 months ago by Alasdair Nicol

Description: modified (diff)
Summary: Add new system check message when 'path.to.view' is cannot be importedAdd new system check message when custom error handler 'path.to.view' cannot be imported

comment:4 Changed 3 months ago by Alasdair Nicol

Has patch: set

comment:5 Changed 2 months ago by Carlton Gibson

Patch needs improvement: set

comment:6 Changed 2 months ago by Alasdair Nicol

Patch needs improvement: unset

comment:7 Changed 8 weeks ago by felixxm

Triage Stage: AcceptedReady for checkin

comment:8 Changed 8 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In a5accc0:

Fixed #30318 -- Added check for importability of arguments of custom error handler views.

Thanks to Jon on Stack Overflow for reporting the issue.

comment:9 Changed 8 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

In 3c3df7db:

[2.2.x] Fixed #30318 -- Added check for importability of arguments of custom error handler views.

Thanks to Jon on Stack Overflow for reporting the issue.

Backport of a5accc0368c6575b55976c06af36ed399c85c781 from master

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