Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override django.contrib.admin.AdminSite instead of modifying it at runtime #42

Closed
okraits opened this issue Jun 21, 2019 · 6 comments · Fixed by #48
Closed

Override django.contrib.admin.AdminSite instead of modifying it at runtime #42

okraits opened this issue Jun 21, 2019 · 6 comments · Fixed by #48
Labels
good first issue Good for new contributors Important High priority or release blocker

Comments

@okraits
Copy link
Member

okraits commented Jun 21, 2019

The function openwisp_admin() in openwisp_utils.admin_theme.admin changes some settings of the vanilla django admin site at runtime. This makes it difficult to use an overridden admin site instead of the default one together with OpenWISP.

It would be better to override the vanilla admin site instead: https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#customizing-the-adminsite-class Then, for further customization, this overridden class can be overridden once more.

@nemesifier
Copy link
Member

The suggested approach would be great!

@atb00ker atb00ker added good first issue Good for new contributors Important High priority or release blocker labels Nov 20, 2019
@atb00ker atb00ker added this to To do (general) in OpenWISP Contributor's Board via automation Nov 20, 2019
@atb00ker atb00ker moved this from To do (general) to To do (Python & Django) in OpenWISP Contributor's Board Nov 20, 2019
@okraits
Copy link
Member Author

okraits commented Dec 5, 2019

@nemesisdesign Could this be an appropriate task for GCI?

@nemesifier
Copy link
Member

One important thing: we should make sure changes will be backward compatible.
Once we finish updating this module, we will have to update the other modules.

@anshuldutt21
Copy link

Can anyone please review my PR

@nemesifier
Copy link
Member

@anshuldutt21 reviewed

anshuldutt21 added a commit to anshuldutt21/openwisp-utils that referenced this issue Dec 11, 2019
anshuldutt21 added a commit to anshuldutt21/openwisp-utils that referenced this issue Dec 11, 2019
@anshuldutt21
Copy link

Hi @nemesisdesign please review the changes.

OpenWISP Contributor's Board automation moved this from To do (Python & Django) to Done Dec 20, 2019
nemesifier added a commit that referenced this issue Dec 20, 2019
[enhancement] Overrided django.contrib.admin.AdminSite #42
nemesifier added a commit that referenced this issue Jan 8, 2020
Simplifies the implementation of OPENWISP_ADMIN_SITE_CLASS
in order to avoid having to change all the openwisp modules.
Meaningless work saved.
nemesifier added a commit that referenced this issue Jan 8, 2020
Simplifies the implementation of OPENWISP_ADMIN_SITE_CLASS
in order to avoid having to change all the openwisp modules.
Meaningless work saved.

Related to #42.
nemesifier added a commit that referenced this issue Jan 8, 2020
Simplifies the implementation of OPENWISP_ADMIN_SITE_CLASS
in order to avoid having to change all the openwisp modules.
Meaningless work saved.

Related to #42
nemesifier added a commit that referenced this issue Jan 9, 2020
Simplifies the implementation of OPENWISP_ADMIN_SITE_CLASS
in order to avoid having to change all the openwisp modules.
Meaningless work saved.

Related to #42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for new contributors Important High priority or release blocker
Development

Successfully merging a pull request may close this issue.

4 participants