Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1905 closed enhancement (wontfix)

[patch] manage.py validate exception when you forget to remove comma

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

Description

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 "manage.py", line 11, in ?
    execute_manager(settings)
  File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1241, in execute_manager
    execute_from_command_line(action_mapping)
  File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1167, in execute_from_command_line
    action_mapping[action]()
  File "/usr/lib/python2.4/site-packages/django/core/management.py", line 948, in validate
    num_errors = get_validation_errors(outfile)
  File "/usr/lib/python2.4/site-packages/django/core/management.py", 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@… 19 years ago.

Download all attachments as: .zip

Change History (3)

by gary.wilson@…, 19 years ago

Attachment: comma.diff added

comment:1 by anonymous, 19 years ago

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

comment:2 by Adrian Holovaty, 19 years ago

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