-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
[admin] Conflicting approach in extending DeviceAdmin #202
Labels
Milestone
Comments
nepython
added a commit
that referenced
this issue
Sep 26, 2020
3 tasks
nemesifier
added
the
Hacktoberfest
Easy issues for attracting Hacktoberfest participants.
label
Sep 30, 2020
nepython
added a commit
that referenced
this issue
Oct 1, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
nepython
added a commit
that referenced
this issue
Oct 1, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
nepython
added a commit
that referenced
this issue
Oct 1, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
nepython
added a commit
that referenced
this issue
Oct 3, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
nepython
added a commit
that referenced
this issue
Oct 3, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
nepython
added a commit
that referenced
this issue
Oct 3, 2020
Closes #202 DeviceAdmin was being extended by two different approaches. Registering a new admin and monkey patching. This could lead to inconsistent behaviour. After this commit we stick to extending DeviceAdmin by (the first approach) registering a new admin and unregistering the previous one. Also ``get_inlines`` helper method has been introduced in Django starting from version 3.0. So to support custom inlines in previous versions we have added ``get_inline_instances`` method. This method can be safely removed when we drop support for Django 2.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I noticed we use 2 different approaches in extending DeviceAdmin at the same time:
we create a new class, unregister the admin from openwisp-controller and register the extended class in openwisp-monitoring, but then we also monkeypatch the class we just defined.
openwisp-monitoring/openwisp_monitoring/device/admin.py
Lines 170 to 203 in 8da5b20
I didn't notice this before, @nepython can you help me to fix this? We should be able to just rewrite all the monkey patching in the class definition above those lines linked.
The text was updated successfully, but these errors were encountered: