Fix gunicorn timeout and add coruse to student
This commit is contained in:
@@ -38,4 +38,4 @@ COPY ./docker/entrypoint.sh ./
|
|||||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
|
|
||||||
# Command to be executed after entry point
|
# 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"]
|
||||||
|
|||||||
@@ -41,9 +41,10 @@ class StudentResource(ModelResource):
|
|||||||
return super().before_import_row(row, **kwargs)
|
return super().before_import_row(row, **kwargs)
|
||||||
|
|
||||||
# If course was addedd as a form kwasrg add it to the student after creation
|
# 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]):
|
def after_init_instance(self, instance: Student, new: bool, row: Dict[str, str], **kwargs: Dict[str, Any | Course]):
|
||||||
if hasattr(kwargs, "course") and isinstance(kwargs["course"], Course):
|
course = kwargs.get("course", None)
|
||||||
instance.course = kwargs["course"]
|
if course and isinstance(course, Course):
|
||||||
|
instance.course = course
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Student
|
model = Student
|
||||||
|
|||||||
Reference in New Issue
Block a user