allow logged in users to assign user groups
This commit is contained in:
+4
-3
@@ -63,12 +63,13 @@ class ExamFormMixin:
|
||||
def __init__(self, *args, user, **kwargs) -> None:
|
||||
super(ModelForm, self).__init__(*args, **kwargs)
|
||||
|
||||
if user.is_superuser or user.groups.filter(name="cid_manager").exists():
|
||||
if user.is_superuser or user.groups.filter(name="cid_user_manager").exists():
|
||||
cid_user_group_queryset = CidUserGroup.objects.all()
|
||||
user_user_group_queryset = UserUserGroup.objects.all()
|
||||
else:
|
||||
cid_user_group_queryset = CidUserGroup.objects.none()
|
||||
user_user_group_queryset = UserUserGroup.objects.none()
|
||||
|
||||
user_user_group_queryset = UserUserGroup.objects.all()
|
||||
|
||||
self.fields["cid_user_groups"] = ModelMultipleChoiceField(
|
||||
required=False,
|
||||
queryset=cid_user_group_queryset,
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
User answer scores are cached, if you update or change an answer you will need to <a href="{% url exam.app_name|add:':exam_scores_refresh' exam.pk %}">refresh the scores</a>.
|
||||
{% endif %}
|
||||
|
||||
{% if missing_cids or missing_users %}
|
||||
<details>
|
||||
<summary>This exam has candidates / users with unsubmitted results</summary>
|
||||
{% if missing_cids %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
The following CIDs results have not been submitted:
|
||||
@@ -23,6 +26,8 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if unmarked %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
The following questions need marking
|
||||
|
||||
Reference in New Issue
Block a user