Fix gunicorn timeout and add coruse to student

This commit is contained in:
2025-11-27 12:48:51 +01:00
parent 09584e22fd
commit cc833c475f
2 changed files with 5 additions and 4 deletions

View File

@@ -38,4 +38,4 @@ COPY ./docker/entrypoint.sh ./
ENTRYPOINT ["/app/entrypoint.sh"]
# Command to be executed after entry point
CMD ["gunicorn", "cntmanage.wsgi:application", "--bind", "0.0.0.0:8000"]
CMD ["gunicorn", "cntmanage.wsgi:application", "--bind", "0.0.0.0:8000", "--timeout", "600"]

View File

@@ -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