Opened 18 years ago

Closed 18 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: dev
Severity: minor Keywords:
Cc: dev@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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@… 18 years ago.

Download all attachments as: .zip

Change History (3)

by dev@…, 18 years ago

Attachment: 2467.diff added

comment:1 by dev@…, 18 years ago

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 by Adrian Holovaty, 18 years ago

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