Improvements to Admin pages for the API Section#289
Conversation
|
I'm in the middle of thoroughly testing this branch as I populate my local database, and I've run into an odd bug. Please tell me if you can reproduce it. Steps to reproduce:
Expected behavior:
What I got instead:
|
|
@scragly any idea when you'll be able to address the reviews here? |
|
Tonight maybe. I only just got the local copy going again today. |
|
excellent. thanks for the quick reply. |
|
@scragly This pull request is very stale. It looks like it's like 98% done, so it'd be a shame to have to close it. I really wish you'd find some time to finish it, but otherwise I'm considering whether we should just merge it even with the reviews unaddressed. I mean, having this feature with a few bugs is probably better than never having it. |
|
I should have a bit of time today to address the reviews and to bring the changes up to date with master. I'll try jump on after breakfast too get it sorted. |
# Conflicts: # pydis_site/apps/api/admin.py
The issue for non-expiring infractions being unable to save changes has been addressed coincidentally, but out of concern that the bot infraction tasks will desync if editing expiry is allowed external to the bot. I've double checked, and turning the expiry read-only results in successful reason edits. |
Through the power of laziness, neglect and sheer forgetfulness, much time has passed, and just as the water stream eventually erodes the rock, we have lost the presence of tags in the database, with them being stored back in repos. Hence, time is the true solution to all that is bad with the world. |
`avatar_hash` is no longer a field stored in the database.
Filter checks for general role membership instead of only those who have the selected role as top role. Noticed during development that we'd not be able to filter to show all Helpers otherwise, as some Helpers have different top roles such as Core Dev that wouldn't give immediately obvious behaviour to user expectations.
a3fe02a to
dafca0f
Compare
Without `blank=True`, admin page editable forms could not be saved if no content was in the end_reason input.
I'm unable to see any cases where this would be wanted, and instead accidental deletion would result in the system possibly breaking, as we are unable to add the setting again to replace it if it got removed. The name has also set to read only in item view, to prevent renames, effectively doing the same thing as deleting it.
3fc5aa7 to
a105de7
Compare


I've added some QOL adjustments to the admin pages by defining
ModelAdminobjects formostall of the API section's models:Bot Settings
See details
Permissions
List View
Columns shown: name
Filter by: None
Item View
Fields: name, data (editable)
Documentation links
See details
Permissions
List View
Columns shown: package, base url (editable), inventory url (editable)
Ordered by: package (alphabetical)
Searchable by: package
Filter by: None
Item View
Fields: package, base url, inventory url
Infractions
See details
Permissions
List View
Columns shown: type, active, user, inserted, reason
Ordered by: inserted descending
Searchable by: id, user name, user id, actor name, actor id, reason, type
Filter by: type, hidden, active, actor
Item View
Fields: user, actor, type, hidden, active, inserted, expires, reason (editable)
Log entries
See details
Permissions
List View
Columns shown: timestamp, level, message
Searchable by: message
Filter by: log level, timestamp
Note: "application" has been removed from filter and columns as we no longer use this api for external logs.
Item View
No changes.
Deleted messages
See details
Permissions
List View
Columns shown: message id, author, channel id
Ordered by: id descending
Searchable by: message id, content, author name, author id, actor name, actor id
Filter by: None
Item View
Fields: id, author, channel id, content, embeds (pretty json formatting), context link, view log (link to staff.pydis log view)
Message deletion contexts
See details
Permissions
List View
Columns shown: id, creation, actor
Ordered by: most recent
Item View
Fields: actor, creation, child messages (as inline tabular view)
Nominations
See details
Permissions
end reason
List View
Columns shown: username (with discrim.), active, reason, actor name (with discrim)
Ordered by: most recent
Searchable by: user name, user id, actor name, actor id, reason, end reason
Filter by: active, actor
Item View
Fields: user, active, actor, reason (editable), created, ended, end reason (editable)
Off topic channel names
See details
Permissions
See details
List View
Columns shown: name
Searchable by: name
Filter by: used
Item View
Fields: name, used
Offensive messages
See details
Permissions
List View
Columns shown: message id, channel id, delete date
Searchable by: message id, channel id
Filter by: None
Item View
Fields: message id (value hyperlinked to discord jumplink), channel id, delete date (editable)
Roles
See details
Permissions
List View
Columns shown: name (coloured)
Ordered by: position
Searchable by: name, id
Filter by: None
Item View
Fields:
API User
See details
Permissions
List View
Columns shown: username (incl. discrim), top role (coloured), in guild
Ordered by: username (incl. discrim)
Searchable by: name, id, role id
Filter by: role membership, in guild
Item View
Fields: username (incl. discrim), id, in_guild, role vertical list (coloured)