File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from django .http import HttpRequest , HttpResponse
66
77from course .models import UserTag , UserTagging
8+ from exercise .exercise_models import BaseExercise
89from .forms import (
910 DeadlineRuleDeviationForm ,
1011 RemoveDeviationForm ,
@@ -37,6 +38,13 @@ class AddDeadlinesView(AddDeviationsView):
3738 def get_success_no_override_url (self ) -> str :
3839 return self .instance .get_url ('deviations-add-dl' )
3940
41+ def get_initial (self ):
42+ initial = super ().get_initial ()
43+ if self .request .GET .get ('get_module_of_exercise' ):
44+ exercise = BaseExercise .objects .get (id = self .request .GET .get ('get_module_of_exercise' ))
45+ initial ['module' ] = [exercise .course_module .id ]
46+ return initial
47+
4048 def get_initial_get_param_spec (self ) -> Dict [str , Optional [Callable [[str ], Any ]]]:
4149 spec = super ().get_initial_get_param_spec ()
4250 spec .update ({
You can’t perform that action at this time.
0 commit comments