diff --git a/course/admin.py b/course/admin.py index 5b0cb4eacec81129b54a95a3f15fa37125098d83..2756ffc411a66505c1b62734b3e285c6f2a29a2b 100644 --- a/course/admin.py +++ b/course/admin.py @@ -591,7 +591,8 @@ class FlowRuleExceptionAdmin(admin.ModelAdmin): search_fields = ( "flow_id", "participation__user__username", - "participation__user__full_name", + "participation__user__first_name", + "participation__user__last_name", "comment", ) diff --git a/course/enrollment.py b/course/enrollment.py index 7acab3fbc3fc42d6e4d0f759f67fbf875917326d..ec48e12f04f192a916f842b455a42b6952269658 100644 --- a/course/enrollment.py +++ b/course/enrollment.py @@ -690,8 +690,6 @@ def query_participations(pctx): return render_course_page(pctx, "course/query-participations.html", { "form": form, "result": result, - "RELATE_DISPLAY_USER_FULLNAME_IN_LIST": getattr( - settings, "RELATE_DISPLAY_USER_FULLNAME_IN_LIST", False), }) # }}} diff --git a/course/grades.py b/course/grades.py index 6015c921028b09684cea09699d0304a404c0dc52..0c3eaa4ca6619f7dbd74b379c7f398b2fc23cf0a 100644 --- a/course/grades.py +++ b/course/grades.py @@ -159,11 +159,8 @@ def view_participant_list(pctx): .order_by("id") .select_related("user")) - from django.conf import settings return render_course_page(pctx, "course/gradebook-participant-list.html", { "participations": participations, - "RELATE_DISPLAY_USER_FULLNAME_IN_LIST": getattr( - settings, "RELATE_DISPLAY_USER_FULLNAME_IN_LIST", False), }) # }}} diff --git a/course/templates/course/participation-table.html b/course/templates/course/participation-table.html index ad3e26a78fdc75f5c497bb453a98c51db75a9cfe..80ee241abc2818cefa14a39dcf2368cd6e573511 100644 --- a/course/templates/course/participation-table.html +++ b/course/templates/course/participation-table.html @@ -3,12 +3,7 @@ <table class="table table-striped gradebook-participants"> <thead> <th class="datacol">{% trans "User ID" %}</th> - {% if RELATE_DISPLAY_USER_FULLNAME_IN_LIST %} - <th class="datacol">{% trans "Full Name" %}</th> - {% else %} - <th class="datacol">{% trans "Last Name" %}</th> - <th class="datacol">{% trans "First Name" %}</th> - {% endif %} + <th class="datacol">{% trans "Name" %}</th> <th class="datacol">{% trans "Role" %}</th> <th class="datacol">{% trans "Tags" %}</th> </thead> @@ -16,12 +11,7 @@ {% for participation in participations %} <tr> <td class="headcol"><a href="{% url "relate-view_participant_grades" course.identifier participation.id %}"><span class="sensitive">{{ participation.user.username }}</span></a></td> - {% if RELATE_DISPLAY_USER_FULLNAME_IN_LIST %} <td class="datacol"><span class="sensitive">{{ participation.user.get_full_name }}</span></td> - {% else %} - <td class="datacol"><span class="sensitive">{{ participation.user.last_name }}</span></td> - <td class="datacol"><span class="sensitive">{{ participation.user.first_name }}</span></td> - {% endif %} <td class="datacol">{{ participation.get_role_desc }}</td> <td class="datacol"> {% for ptag in participation.tags.all %} diff --git a/local_settings.py.example b/local_settings.py.example index a10c312959771d2f214c5b163b94947d9aa55dc2..6276d725d400edea9c3d468b49abc7f20ea61cc0 100644 --- a/local_settings.py.example +++ b/local_settings.py.example @@ -108,7 +108,7 @@ RELATE_EDITABLE_INST_ID_BEFORE_VERIFICATION = True # {{{ user full_name format -# RELATE's default fullname format is "'%s %s' % (first_name, last_name)", +# RELATE's default full_name format is "'%s %s' % (first_name, last_name)", # you can override it by supply a customized method/fuction, with # "firstname" and "lastname" as its paramaters, and return a string. @@ -133,25 +133,14 @@ RELATE_EDITABLE_INST_ID_BEFORE_VERIFICATION = True # ["first_name", "email", "username"], when first_name is not None # (e.g, first_name = "Foo"), the email will be opened # by "Dear Foo,". If first_name is None, then email will be used -# as appelation, so on and so force. +# as appelation, so on and so forth. -# you can override the appelation priority by supply a customized list, -# available list named RELATE_EMAIL_APPELATION_PRIORITY_LIST. The available +# you can override the appelation priority by supply a customized list +# named RELATE_EMAIL_APPELATION_PRIORITY_LIST. The available # elements include first_name, last_name, get_full_name, email and # username. -#RELATE_EMAIL_APPELATION_PRIORITY_LIST = ["first_name", "email", "username", "full_name"] - -# }}} - -# {{{ - -# When displayed in lists, user realname is diplayed by two fields, -# last_name and first_name, so that the bpth fields can be ordered. -# You can set the following configuration to True if you want to -# display name using full_name format. - -#RELATE_DISPLAY_USER_FULLNAME_IN_LIST = True +#RELATE_EMAIL_APPELATION_PRIORITY_LIST = ["full_name", "first_name", "email", "username"] # }}} diff --git a/relate/settings.py b/relate/settings.py index d2b811c9bd79fa8fc9d18feb6d4f10024c7138c4..142bccc53315f8e89bd6392e61a7fd6798bcec2f 100644 --- a/relate/settings.py +++ b/relate/settings.py @@ -287,9 +287,4 @@ if "RELATE_EMAIL_APPELATION_PRIORITY_LIST" in local_settings: assert isinstance( local_settings["RELATE_EMAIL_APPELATION_PRIORITY_LIST"], list) -# This makes sure RELATE_DISPLAY_USER_FULLNAME_IN_LIST is a bool -if "RELATE_DISPLAY_USER_FULLNAME_IN_LIST" in local_settings: - assert isinstance( - local_settings["RELATE_DISPLAY_USER_FULLNAME_IN_LIST"], bool) - # vim: foldmethod=marker