mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 01:37:11 +00:00
lint: linted
This commit is contained in:
@@ -13,16 +13,17 @@ class CompetitionOut(ModelSchema):
|
||||
model = Competition
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class StateOut(ModelSchema):
|
||||
class Meta:
|
||||
model = State
|
||||
fields = (
|
||||
"state",
|
||||
)
|
||||
fields = ("state",)
|
||||
|
||||
|
||||
class StateIn(Schema):
|
||||
state: Literal["started", "not_started", "finished"]
|
||||
|
||||
|
||||
class CompetitionListInstanceOut(ModelSchema):
|
||||
id: UUID
|
||||
is_participating: bool
|
||||
@@ -36,7 +37,9 @@ class CompetitionListInstanceOut(ModelSchema):
|
||||
@staticmethod
|
||||
def resolve_completed(self, context):
|
||||
user = context["request"].auth
|
||||
return State.objects.filter(competition=self, user=user, state="finished").exists()
|
||||
return State.objects.filter(
|
||||
competition=self, user=user, state="finished"
|
||||
).exists()
|
||||
|
||||
class Meta:
|
||||
model = Competition
|
||||
|
||||
Reference in New Issue
Block a user