Opened 10 years ago

Closed 10 years ago

#2467 closed defect (fixed)

[patch] date_hierarchy in model is not checked for validity.

Reported by: Simon Greenhill, dev@… Owned by: Adrian Holovaty
Component: contrib.admin Version: master
Severity: minor Keywords:
Cc: dev@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When one of the models has the date_hierarchy incorrectly set ( i.e. typo, or the string isn't a field in the model ), the admin section fails with a template syntax error:

FieldDoesNotExist at /admin/<app>/<something>/
Link has no field named '<misspelt field name>')

I've modified django.core.management.get_validation_errors to check that the field specified in date_hierarchy is a valid model field.

Attachments (1)

2467.diff (845 bytes) - added by dev@… 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by dev@…

Attachment: 2467.diff added

comment:1 Changed 10 years ago by dev@…

This might also fix ticket:1377 - Looking at it, it looks like that error occured due to date_hierarchy being passed a tuple and not a string.

comment:2 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [3516]) Fixed #2467 -- Improved model validator to check date_hierarchy. Thanks, Simon Greenhill

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