Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#426 closed defect (fixed)

ContentTypeDoesNotExist thrown whenever CRUD actions are performed in admin

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

Description

Whenever I create, modify, or delete objects in the admin interface for my project I recieve the following error:

There's been an error:

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 64, in get_response
    response = callback(request, **param_dict)

  File "/usr/lib/python2.3/site-packages/django/views/admin/main.py", line 894, in change_stage
    log.log_action(request.user.id, opts.get_content_type_id(), pk_value, repr(new_object), log.CHANGE, change_message)

  File "/usr/lib/python2.3/site-packages/django/core/meta/__init__.py", line 241, in get_content_type_id
    self._content_type_id = mod.get_object(python_module_name__exact=self.module_name, package__label__exact=self.app_label).id

  File "/usr/lib/python2.3/site-packages/django/utils/functional.py", line 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))

  File "/usr/lib/python2.3/site-packages/django/core/meta/__init__.py", line 1082, in function_get_object
    raise does_not_exist_exception, "%s does not exist for %s" % (opts.object_name, kwargs)

ContentTypeDoesNotExist: ContentType does not exist for {'package__label__exact': 'myproject', 'python_module_name__exact': 'foos'}

The action always works, but this error is thrown nonetheless.

Change History (2)

comment:1 Changed 10 years ago by jacob

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

This means you haven't correct inserted into the database the metadata Django needs to keep track of your objects. Do django-admin.py sqlinitialdata <yourapp> to see what this metadata should be, and insert it yourself. (django-admin install would have done this for you, but if you're getting this message it means you didn't use install).

comment:2 Changed 10 years ago by jmadson@…

Thanks! Perhaps that exception should print something to that effect?

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