-
-
Notifications
You must be signed in to change notification settings - Fork 89
[change] Remove deprecated UUIDAdmin class #328 #551
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
base: master
Are you sure you want to change the base?
[change] Remove deprecated UUIDAdmin class #328 #551
Conversation
740de44 to
5552ab6
Compare
Removed the deprecated UUIDAdmin class which was kept for backward
compatibility. The CopyableFieldsAdmin class should be used instead
with copyable_fields = ('uuid',) to achieve the same functionality.
- Removed UUIDAdmin class from openwisp_utils/admin.py
- Updated test ProjectAdmin to use CopyableFieldsAdmin directly
- Removed UUIDAdmin documentation from admin-utilities.rst
Closes openwisp#328
5552ab6 to
81defd0
Compare
📝 WalkthroughWalkthroughThe changes remove the deprecated Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
🧰 Additional context used🧬 Code graph analysis (1)tests/test_project/admin.py (1)
🪛 Ruff (0.14.14)tests/test_project/admin.py[warning] 84-84: Mutable class attributes should be annotated with (RUF012) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Removes the deprecated UUIDAdmin helper and updates internal test/admin and documentation references to use CopyableFieldsAdmin instead.
Changes:
- Removed
UUIDAdminfromopenwisp_utils/admin.py. - Updated the test
ProjectAdminto inherit fromCopyableFieldsAdminand explicitly configurecopyable_fields. - Removed the
UUIDAdminsection from the admin utilities documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_project/admin.py |
Switches ProjectAdmin from UUIDAdmin to CopyableFieldsAdmin and reintroduces the uuid display method + copyable_fields locally. |
openwisp_utils/admin.py |
Deletes the deprecated UUIDAdmin class implementation. |
docs/developer/admin-utilities.rst |
Removes the UUIDAdmin documentation section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -48,14 +48,6 @@ it easy to copy the fields contents. | |||
|
|
|||
| Useful for auto-generated fields such as UUIDs, secret keys, tokens, etc. | |||
|
|
|||
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After removing UUIDAdmin, this section no longer documents how to replicate the common “copy UUID” behavior. Consider adding a brief note here explaining that CopyableFieldsAdmin can replace UUIDAdmin by setting copyable_fields = ('uuid',) and defining a uuid() display method (as done in tests/test_project/admin.py).
| To replicate the common "copy UUID" behavior previously provided by | |
| ``UUIDAdmin``, you can use ``CopyableFieldsAdmin`` by setting | |
| ``copyable_fields = ("uuid",)`` and defining a ``uuid()`` display method, | |
| for example: | |
| .. code-block:: python | |
| from django.contrib import admin | |
| from openwisp_utils.admin import CopyableFieldsAdmin | |
| from .models import MyModel | |
| @admin.register(MyModel) | |
| class MyModelAdmin(CopyableFieldsAdmin): | |
| copyable_fields = ("uuid",) | |
| readonly_fields = ("uuid",) | |
| def uuid(self, obj): | |
| return obj.uuid | |
| uuid.short_description = "UUID" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nemesifier is it necesaary to put this , or we can leave ?
Checklist
Removed the deprecated UUIDAdmin class which was kept for backward compatibility. The CopyableFieldsAdmin class should be used instead with copyable_fields = ('uuid',) to achieve the same functionality.
Closes #328