Add user search widget to exam_users_edit.html for adding arbitrary users

This commit is contained in:
Ross
2026-04-13 09:54:18 +01:00
parent 126d186ad1
commit 3e03413047
2 changed files with 44 additions and 5 deletions
+9
View File
@@ -2419,6 +2419,15 @@ class ExamViews(View, LoginRequiredMixin):
"app_name": self.app_name,
}
# Provide a searchable widget to allow adding arbitrary users
try:
from generic.widgets import UserSearchSelectMultipleWidget
widget_html = UserSearchSelectMultipleWidget("add_users", []).render()
context["user_search_widget"] = mark_safe(widget_html)
except Exception:
context["user_search_widget"] = ""
if self.app_name == "atlas":
context["collection"] = exam