diff --git a/.gitignore b/.gitignore index 68bc17f..b2c4db2 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/src/pwncore/models/ctf.py b/src/pwncore/models/ctf.py index b69206a..720a39a 100644 --- a/src/pwncore/models/ctf.py +++ b/src/pwncore/models/ctf.py @@ -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] @@ -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", ) diff --git a/src/pwncore/routes/admin.py b/src/pwncore/routes/admin.py index 27cf541..b5fb468 100644 --- a/src/pwncore/routes/admin.py +++ b/src/pwncore/routes/admin.py @@ -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", @@ -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",