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"]
|
||||
|
||||
# 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)
|
||||
|
||||
# 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