fix: permission issue when a student submits an exercise
This commit is contained in:
@@ -24,6 +24,8 @@ class Exercise(Document):
|
|||||||
},
|
},
|
||||||
order_by="creation desc",
|
order_by="creation desc",
|
||||||
page_length=1)
|
page_length=1)
|
||||||
|
|
||||||
|
print("get_user_submission", result)
|
||||||
if result:
|
if result:
|
||||||
return result[0]
|
return result[0]
|
||||||
|
|
||||||
@@ -49,6 +51,6 @@ class Exercise(Document):
|
|||||||
lesson=self.lesson,
|
lesson=self.lesson,
|
||||||
batch=batch and batch.name,
|
batch=batch and batch.name,
|
||||||
solution=code)
|
solution=code)
|
||||||
doc.insert()
|
doc.insert(ignore_permissions=True)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user