.
This commit is contained in:
@@ -602,6 +602,8 @@ class CaseCollection(models.Model):
|
||||
CidUser, blank=True, related_name="casecollection_exams"
|
||||
)
|
||||
|
||||
archive = models.BooleanField(default=False)
|
||||
|
||||
class COLLECTION_TYPE_CHOICES(models.TextChoices):
|
||||
REVIEW = (
|
||||
"REV",
|
||||
|
||||
@@ -77,6 +77,15 @@
|
||||
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
CaseCollection Exams<br />
|
||||
<select id="casecollection-exams" multiple="multiple">
|
||||
{% for name, id in casecollection_exams %}
|
||||
<option value="{{id}}">{{name}}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -185,6 +194,7 @@
|
||||
sba_exams: JSON.stringify($("#sbas-exams").val()),
|
||||
longs_exams: JSON.stringify($("#longs-exams").val()),
|
||||
anatomy_exams: JSON.stringify($("#anatomy-exams").val()),
|
||||
casecollection_exams: JSON.stringify($("#casecollection-exams").val()),
|
||||
cid_groups: JSON.stringify($("#cid-groups").val()),
|
||||
delete: false,
|
||||
emails: JSON.stringify(false),
|
||||
|
||||
@@ -33,6 +33,7 @@ from django.views.generic.edit import CreateView, UpdateView
|
||||
from django_filters.views import FilterView
|
||||
from django_tables2.views import SingleTableMixin
|
||||
from reversion.views import RevisionMixin
|
||||
from atlas.models import CaseCollection
|
||||
from generic.decorators import user_is_cid_user_manager
|
||||
from generic.filters import CidUserFilter
|
||||
|
||||
@@ -1379,6 +1380,7 @@ class CidUserView(CidManagerRequiredMixin, SingleTableMixin, FilterView):
|
||||
sba_exams = [(i.name, i.pk) for i in SbasExam.objects.filter(**filters)]
|
||||
longs_exams = [(i.name, i.pk) for i in LongExam.objects.filter(**filters)]
|
||||
anatomy_exams = [(i.name, i.pk) for i in AnatomyExam.objects.filter(**filters)]
|
||||
casecollection_exams = [(i.name, i.pk) for i in CaseCollection.objects.filter(archive=False, collection_type_gt = 0)]
|
||||
|
||||
cid_user_groups = [
|
||||
(i.name, i.pk) for i in CidUserGroup.objects.filter(archive=False)
|
||||
@@ -1389,6 +1391,7 @@ class CidUserView(CidManagerRequiredMixin, SingleTableMixin, FilterView):
|
||||
context["sba_exams"] = sba_exams
|
||||
context["longs_exams"] = longs_exams
|
||||
context["anatomy_exams"] = anatomy_exams
|
||||
context["casecollection_exams"] = casecollection_exams
|
||||
context["cid_user_groups"] = cid_user_groups
|
||||
|
||||
cid_user_groups = [
|
||||
@@ -1530,6 +1533,7 @@ def manage_cid_users(request):
|
||||
sba_exams = json.loads(request.POST.get("sba_exams"))
|
||||
longs_exams = json.loads(request.POST.get("longs_exams"))
|
||||
anatomy_exams = json.loads(request.POST.get("anatomy_exams"))
|
||||
casecollection_exams = json.loads(request.POST.get("casecollection_exams"))
|
||||
cid_groups = json.loads(request.POST.get("cid_groups"))
|
||||
|
||||
selected_cids = json.loads(request.POST.get("selected_cids"))
|
||||
@@ -1586,6 +1590,7 @@ def manage_cid_users(request):
|
||||
c.sba_exams.clear()
|
||||
c.longs_exams.clear()
|
||||
c.anatomy_exams.clear()
|
||||
c.casecollection_exams.clear()
|
||||
return JsonResponse({"status": "success"})
|
||||
|
||||
if add_exams == "true":
|
||||
@@ -1606,6 +1611,9 @@ def manage_cid_users(request):
|
||||
if anatomy_exams:
|
||||
c.anatomy_exams.set(anatomy_exams)
|
||||
c.save()
|
||||
if casecollection_exams:
|
||||
c.casecollection_exams.set(casecollection_exams)
|
||||
c.save()
|
||||
return JsonResponse({"status": "success"})
|
||||
|
||||
try:
|
||||
@@ -1637,6 +1645,9 @@ def manage_cid_users(request):
|
||||
if anatomy_exams:
|
||||
c.anatomy_exams.set(anatomy_exams)
|
||||
c.save()
|
||||
if casecollection_exams:
|
||||
c.casecollection_exams.set(casecollection_exams)
|
||||
c.save()
|
||||
new_cid = new_cid + 1
|
||||
|
||||
for n in range(number_to_create):
|
||||
@@ -1661,6 +1672,9 @@ def manage_cid_users(request):
|
||||
if anatomy_exams:
|
||||
c.anatomy_exams.set(anatomy_exams)
|
||||
c.save()
|
||||
if casecollection_exams:
|
||||
c.casecollection_exams.set(casecollection_exams)
|
||||
c.save()
|
||||
new_cid = new_cid + 1
|
||||
|
||||
return JsonResponse({"status": "success"})
|
||||
|
||||
Reference in New Issue
Block a user