diff options
author | 2020-09-18 12:45:25 +1000 | |
---|---|---|
committer | 2020-09-18 12:45:25 +1000 | |
commit | f132c485c7ecff661a257dcdf4b528b7300e95c1 (patch) | |
tree | f27c50db93027536a1c89029419b7b548a887dce /pydis_site/apps/api/admin.py | |
parent | Add return types and docstrings for new user admin changes. (diff) |
Fix format-style not supporting X hex casting like f-strings.
Diffstat (limited to 'pydis_site/apps/api/admin.py')
-rw-r--r-- | pydis_site/apps/api/admin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/admin.py b/pydis_site/apps/api/admin.py index d77ae620..15a1ec78 100644 --- a/pydis_site/apps/api/admin.py +++ b/pydis_site/apps/api/admin.py @@ -277,8 +277,8 @@ class UserAdmin(admin.ModelAdmin): def top_role_coloured(self, user: User) -> SafeString: """Returns the top role of the user with html style matching role colour.""" return format_html( - '<span style="color: #{0:06X}; font-weight: bold;">{1}</span>', - user.top_role.colour, + '<span style="color: {0}; font-weight: bold;">{1}</span>', + f"#{user.top_role.colour:06X}", user.top_role.name ) |