mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 03:57:09 +00:00
feat: added submissions history, formatted
This commit is contained in:
@@ -11,12 +11,17 @@ class CompetitionOut(ModelSchema):
|
||||
state: Literal["not_started", "started", "finished"]
|
||||
|
||||
@staticmethod
|
||||
def resolve_state(self, context) -> Literal["not_started", "started", "finished"]:
|
||||
if not (state := State.objects.filter(user=context.get("request").auth, competition=self).first()):
|
||||
def resolve_state(
|
||||
self, context
|
||||
) -> Literal["not_started", "started", "finished"]:
|
||||
if not (
|
||||
state := State.objects.filter(
|
||||
user=context.get("request").auth, competition=self
|
||||
).first()
|
||||
):
|
||||
return "not_started"
|
||||
return state.state
|
||||
|
||||
|
||||
class Meta:
|
||||
model = Competition
|
||||
exclude = ("participants",)
|
||||
|
||||
Reference in New Issue
Block a user