Fix gunicorn timeout and add coruse to student
This commit is contained in:
@@ -41,9 +41,10 @@ class StudentResource(ModelResource):
|
||||
return super().before_import_row(row, **kwargs)
|
||||
|
||||
# If course was addedd as a form kwasrg add it to the student after creation
|
||||
def after_init_instance(self, instance: Student, new: bool, row: Dict[str, str], **kwargs: Dict[str, Any]):
|
||||
if hasattr(kwargs, "course") and isinstance(kwargs["course"], Course):
|
||||
instance.course = kwargs["course"]
|
||||
def after_init_instance(self, instance: Student, new: bool, row: Dict[str, str], **kwargs: Dict[str, Any | Course]):
|
||||
course = kwargs.get("course", None)
|
||||
if course and isinstance(course, Course):
|
||||
instance.course = course
|
||||
|
||||
class Meta:
|
||||
model = Student
|
||||
|
||||
Reference in New Issue
Block a user