Closed mustafaabughazy closed 2 months ago
Merging #203 (e313772) into master (57d0bc0) will increase coverage by
0.58%
. The diff coverage is98.55%
.
@@ Coverage Diff @@
## master #203 +/- ##
==========================================
+ Coverage 97.11% 97.70% +0.58%
==========================================
Files 22 22
Lines 520 653 +133
==========================================
+ Hits 505 638 +133
Misses 15 15
Impacted Files | Coverage Δ | |
---|---|---|
src/rest_framework_api_key/admin.py | 90.32% <94.87%> (+13.39%) |
:arrow_up: |
tests/test_admin.py | 100.00% <100.00%> (ø) |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
Thanks again @Mustafa-Abu-Ghazy for opening this. As in #204, I need to ask for us to write up what problem these changes help address. If possible, let's do this in an issue explaining what practical problems or limitations currently exist with the default ModelAdmin.
Hi @florimondmanca,
It's not a problem as much it's enhancement for the user experience while dealing with the APIKeyModelAdmin
search_help_text
its a new option in Django 4.0, to add description below the search bar guiding the user by which values could be used for search.revoke
a key, instead of editing the field manually.
revoke
action is limited to the users have change permission (to keep the same authorization level as before).verify
action to be used for that purpose.Both of revoke
and verify
actions add a log into the LogEntry table and will be shown in the instance change history.
Enhance APIKey ModelAdmin Class
Adding ("expiry_date", "revoked") to list_filter
Adding search_help_text (New in Django 4.0)
Adding "revoked" to readonly_fields (Depend on the New revoke action to revoke an APIKey)
Adding Organized fieldsets
Adding ("revoke", "verify") actions
Adding test-cases cover the changes