Django

Code

Ticket #3219 (closed: wontfix)

Opened 2 years ago

Last modified 2 years ago

Invalid admin attribute should not cause a metaclass error

Reported by: Robert Myers <myer0052@gmail.com> Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: myer0052@gmail.com Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When a invalid admin attribute is used a metaclass error is raised.

Example:

    class BadAdminOption(models.Model):
        name = models.CharField(maxlength=30)
    
        class Admin:
            nonexistent = 'option'

Expecting Error::

    "admin" attribute, if given, must be set to a models.AdminOptions() instance.

Actual Error::

    Error when calling the metaclass bases
    __init__() got an unexpected keyword argument 'nonexistent'

Attachments

Change History

01/17/07 16:40:55 changed by Robert Myers <myer0052@gmail.com>

Should be closed as wontfix since the newadmin will not be using AdminOptions?() any more.

02/19/07 08:18:40 changed by Robert Myers <myer0052@gmail.com>

  • status changed from new to closed.
  • resolution set to wontfix.

Since this is about to change there is no need to fix this ticket, the newforms-admin branch will correct this error.


Add/Change #3219 (Invalid admin attribute should not cause a metaclass error)




Change Properties
Action