Skip to content

Commit

Permalink
Model modifications to support hint unlocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Lareau committed Jan 10, 2020
1 parent 210bf01 commit 41365a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions huntserver/migrations/0041_auto_20200110_1408.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-01-10 19:08
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('huntserver', '0040_auto_20200108_1126'),
]

operations = [
migrations.AddField(
model_name='hunt',
name='hint_lockout',
field=models.IntegerField(default=60),
),
migrations.AddField(
model_name='team',
name='num_available_hints',
field=models.IntegerField(default=0),
),
]
4 changes: 4 additions & 0 deletions huntserver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class Hunt(models.Model):
help_text="A misc. field for any extra data to be stored with the hunt.")
template = models.TextField(default="",
help_text="The template string to be rendered to HTML on the hunt page")
hint_lockout = models.IntegerField(default=settings.DEFAULT_HINT_LOCKOUT)



# A bit of custom logic in clean and save to ensure exactly one hunt's
# is_current_hunt is true at any time. It makes sure you can never un-set the
Expand Down Expand Up @@ -200,6 +203,7 @@ class Team(models.Model):
help_text="A boolean to indicate if the team is a playtest team and will get early access")
last_seen_message = models.IntegerField(default=0)
last_received_message = models.IntegerField(default=0)
num_available_hints = models.IntegerField(default=0)

@property
def is_playtester_team(self):
Expand Down

0 comments on commit 41365a4

Please sign in to comment.