jsocol / jsocol/django-adminplus

Missing core models from admin after adding adminplus

Open
#42 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
602
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Hi,

Just spent today integrating adminplus into our Django 1.8.7 site, found an issue where 3 of our admin screens went missing after the upgrade.Turns out they are all core models (Groups, Users and Sites) and these are all added by an autodiscover that django runs before it loads the urls file.
See traceback for when the first one is added:
traceback
Saw this in a previous issue and it has solved the issue for now although I am hoping someone smarter than I can help us solve it better:

import copy
from django.contrib import admin
from django.conf.urls import patterns, include, url

from adminplus.sites import AdminSitePlus

old = admin.site
admin.site = AdminSitePlus()
admin.site._registry = copy.copy(old._registry)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining Django admin autodiscover and the adminplus.sites.AdminSitePlus entry point, using the reported traceback to follow registration before URL loading. Compare the copied admin.site._registry workaround with the normal core-model registration flow. Done means Groups, Users, and Sites remain available in the admin without that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.