Skip to content
Snippets Groups Projects
Verified Commit 62bda940 authored by Lukas Schauer's avatar Lukas Schauer :unlock:
Browse files

hide archived terms from course creation dialog

parent c5dd2b52
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,12 @@ class CourseForm(forms.ModelForm):
del kwargs['request']
forms.ModelForm.__init__(self, *args, **kwargs, initial = initial)
if 'instance' in kwargs and kwargs['instance'].term.archived:
self.fields['term'].disabled = True
else:
self.fields['term'].queryset = Term.objects.filter(archived=False)
if not request.user.is_staff:
self.fields['hidden'].disabled = True
self.fields['owner'].disabled = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment