Skip to content

Commit

Permalink
add: dynamic points
Browse files Browse the repository at this point in the history
  • Loading branch information
WizzyGeek committed Jan 10, 2024
1 parent 5a6af64 commit bdd2c4a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

src/pwncore/utils.py
6 changes: 3 additions & 3 deletions src/pwncore/models/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Problem(BaseProblem):
null=True
) # type: ignore[assignment]

mi = fields.IntField()
ma = fields.IntField()
mi = fields.IntField(default=100) # Arbitrary meaning full defaults
ma = fields.IntField(default=600)

hints: fields.ReverseRelation[Hint]

Expand Down Expand Up @@ -76,7 +76,7 @@ class Meta:


class ViewedHint(Model):
team: fields.ForeignKeyRelation[Team] = fields.ForeignKeyField("models.Team")
team: fields.ForeignKeyRelation[Team] = fields.ForeignKeyField("models.Team", related_name="viewedhints")
hint: fields.ForeignKeyRelation[Hint] = fields.ForeignKeyField(
"models.Hint",
)
Expand Down
4 changes: 4 additions & 0 deletions src/pwncore/routes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ async def init_db():
points=300,
image_name="key:latest",
image_config={"PortBindings": {"22/tcp": [{}]}},
mi=200,
ma=400,
)
await PreEventProblem.create(
name="Static_test",
Expand All @@ -81,6 +83,8 @@ async def init_db():
points=300,
image_name="key:latest",
image_config={"PortBindings": {"22/tcp": [{}]}},
mi=200,
ma=400,
)
await Problem.create(
name="GitGood",
Expand Down

0 comments on commit bdd2c4a

Please sign in to comment.