Add user search widget to exam_users_edit.html for adding arbitrary users
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user