Skip to content

Commit 0ffade2

Browse files
authored
Fix django admin (#2932)
1 parent a13acc1 commit 0ffade2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

openedx/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class OpenEdxUserAdmin(ModelAdminRunActionsForAllMixin, admin.ModelAdmin):
2020
raw_id_fields = ["user"]
2121
actions = ["repair_all_faulty_openedx_users"]
2222
run_for_all_actions = ["repair_all_faulty_openedx_users"]
23+
readonly_fields = ["has_sync_error", "sync_error_data"]
2324

2425
def get_queryset(self, request):
2526
"""Overrides base queryset"""

users/admin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ def has_delete_permission(self, request, obj=None): # noqa: ARG002
4848

4949

5050
_username_warning = """
51-
<div style="background-color: #dc3545; color: #fff; padding: 10px; font-size: 16px; border-radius: 5px;">
52-
<strong>WARNING:</strong>
51+
<div style="background-color: #dc3545; color: #fff; padding: 10px; font-size: 16px; border-radius: 5px; margin-bottom: 10px;">
52+
<strong>WARNING:</strong><br/>
5353
Changing this username will require you to apply the same change in edX immediately after.<br /><br>
5454
Do not make this change unless you can perform the same change to the edX username, or you have someone
5555
else lined up to do it.
5656
</div>
57+
<div style="background-color: #0088e2; color: #fff; padding: 10px; font-size: 16px; border-radius: 5px;">
58+
<strong>NOTE:</strong><br/>
59+
If the user has not been synced to openedx yet, you will need to set Desired Edx Username as well. <br/><br/>
60+
This is ultimately the source of truth on what value to start with when attempting to create the user.
61+
</div>
5762
"""
5863

5964

@@ -86,6 +91,7 @@ def pretty_sync_error_data(self, instance):
8691
{
8792
"fields": (
8893
"edx_username",
94+
"desired_edx_username",
8995
"has_been_synced",
9096
"has_sync_error",
9197
"pretty_sync_error_data",

0 commit comments

Comments
 (0)