Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1905 closed enhancement (wontfix)

[patch] validate exception when you forget to remove comma

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


When upgrading to post-magic-removal merge, forgetting to remove the pesky comma here

class Admin:
    list_display = ('owner','name'),

will give you

Traceback (most recent call last):
  File "", line 11, in ?
  File "/usr/lib/python2.4/site-packages/django/core/", line 1241, in execute_manager
  File "/usr/lib/python2.4/site-packages/django/core/", line 1167, in execute_from_command_line
  File "/usr/lib/python2.4/site-packages/django/core/", line 948, in validate
    num_errors = get_validation_errors(outfile)
  File "/usr/lib/python2.4/site-packages/django/core/", line 894, in get_validation_errors
    if not hasattr(cls, fn):
TypeError: hasattr(): attribute name must be string

A more friendly message would be helpful...

Attachments (1)

comma.diff (1.2 KB) - added by gary.wilson@… 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by gary.wilson@…

Attachment: comma.diff added

comment:1 Changed 12 years ago by anonymous

Summary: validate exception when you forget to remove comma[patch] validate exception when you forget to remove comma

comment:2 Changed 12 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

This seems to be too much of a special-casish bit of logic.

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