From ae657387663aeac004a1fd71e02df899b39b8d1d Mon Sep 17 00:00:00 2001 From: Dmytro Polityka Date: Fri, 26 Jul 2024 11:06:05 +0200 Subject: [PATCH] fix wrongly initialized repository flag --- athena/athena/schemas/feedback.py | 4 ++-- athena/athena/storage/feedback_storage.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/athena/athena/schemas/feedback.py b/athena/athena/schemas/feedback.py index f4d7e48a7..4cf9c6a2e 100644 --- a/athena/athena/schemas/feedback.py +++ b/athena/athena/schemas/feedback.py @@ -29,8 +29,8 @@ class Feedback(Schema, ABC): exercise_id: int = Field(example=1) submission_id: int = Field(example=1) - def to_model(self, is_suggestion: bool = False, lms_id: Optional[int] = None): - return type(self).get_model_class()(**self.dict(), is_suggestion=is_suggestion, lms_id=lms_id) + def to_model(self, is_suggestion: bool = False, lms_id: Optional[int] = None, lms_url: Optional[str] = None): + return type(self).get_model_class()(**self.dict(), is_suggestion=is_suggestion, lms_id=lms_id, lms_url=lms_url) class Config: orm_mode = True diff --git a/athena/athena/storage/feedback_storage.py b/athena/athena/storage/feedback_storage.py index 05722dea4..7e917e769 100644 --- a/athena/athena/storage/feedback_storage.py +++ b/athena/athena/storage/feedback_storage.py @@ -59,7 +59,7 @@ def store_feedback(feedback: Feedback, is_lms_id=False, lms_url: Optional[str] = lms_url=lms_url).scalar() feedback.id = internal_id - stored_feedback_model = db.merge(feedback.to_model(lms_id=lms_id)) + stored_feedback_model = db.merge(feedback.to_model(lms_id=lms_id, lms_url=lms_url)) db.commit() return stored_feedback_model.to_schema()