Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1905 closed enhancement (wontfix)

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

Reported by: gary.wilson@… Owned by: adrian
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:

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

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by gary.wilson@…

comment:1 Changed 9 years ago by anonymous

  • Summary changed from manage.py validate exception when you forget to remove comma to [patch] manage.py validate exception when you forget to remove comma

comment:2 Changed 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

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

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