Skip to content

Conversation

@Eeshu-Yadav
Copy link
Contributor

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

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 #328

@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/328-remove-depre-UUID branch from 740de44 to 5552ab6 Compare December 26, 2025 14:02
@coveralls
Copy link

coveralls commented Dec 26, 2025

Coverage Status

coverage: 97.11% (-0.005%) from 97.115%
when pulling 81defd0 on Eeshu-Yadav:issues/328-remove-depre-UUID
into 1caa9ce on openwisp:master.

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
Copilot AI review requested due to automatic review settings January 31, 2026 05:42
@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/328-remove-depre-UUID branch from 5552ab6 to 81defd0 Compare January 31, 2026 05:42
@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

The changes remove the deprecated UUIDAdmin class from openwisp_utils/admin.py and its associated documentation. The UUIDAdmin class previously provided a reusable admin configuration for displaying copyable UUID fields. Its functionality is now duplicated directly in the test project's ProjectAdmin class, which replaces UUIDAdmin with CopyableFieldsAdmin as a base class and explicitly defines the UUID field configuration inline.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the main changes, references the closed issue, and explains the migration path. However, the unchecked 'updated tests' and 'updated documentation' items are misleading. Clarify the documentation checklist items: documentation was updated (admin-utilities.rst) and tests were updated (ProjectAdmin), so these checkboxes should be marked as complete.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing the deprecated UUIDAdmin class as referenced in issue #328.
Linked Issues check ✅ Passed The PR successfully removes the deprecated UUIDAdmin class from the codebase and updates all references, fully satisfying the requirements of issue #328.
Out of Scope Changes check ✅ Passed All changes are directly related to removing UUIDAdmin and updating affected code; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1caa9ce and 81defd0.

📒 Files selected for processing (3)
  • docs/developer/admin-utilities.rst
  • openwisp_utils/admin.py
  • tests/test_project/admin.py
💤 Files with no reviewable changes (2)
  • docs/developer/admin-utilities.rst
  • openwisp_utils/admin.py
🧰 Additional context used
🧬 Code graph analysis (1)
tests/test_project/admin.py (1)
openwisp_utils/admin.py (2)
  • CopyableFieldsAdmin (72-134)
  • ReceiveUrlAdmin (137-190)
🪛 Ruff (0.14.14)
tests/test_project/admin.py

[warning] 84-84: Mutable class attributes should be annotated with typing.ClassVar

(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)
  • GitHub Check: CodeQL analysis (python)
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.0.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.11 | django~=5.0.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=5.0.0
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Agent
🔇 Additional comments (2)
tests/test_project/admin.py (2)

5-12: LGTM on the import change.

The import correctly switches from the deprecated UUIDAdmin to CopyableFieldsAdmin, aligning with the PR objective.


82-94: Clean migration from deprecated UUIDAdmin.

The implementation correctly replicates the UUIDAdmin functionality by:

  1. Inheriting from CopyableFieldsAdmin
  2. Defining copyable_fields = ("uuid",)
  3. Adding the uuid method with appropriate short_description

The multiple inheritance with ReceiveUrlAdmin works correctly since both parent classes properly delegate via super().

Regarding the static analysis hint (RUF012) on line 84 about inlines = [OperatorInline]: this is a false positive for Django admin classes. Mutable class attributes like inlines are standard Django admin patterns and don't cause issues in this context.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a 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 UUIDAdmin from openwisp_utils/admin.py.
  • Updated the test ProjectAdmin to inherit from CopyableFieldsAdmin and explicitly configure copyable_fields.
  • Removed the UUIDAdmin section 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.

Copy link

Copilot AI Jan 31, 2026

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).

Suggested change
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"

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[!change] Remove deprecated UUIDAdmin class

2 participants