aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/models
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-07-12 13:14:30 +0200
committerGravatar GitHub <[email protected]>2019-07-12 13:14:30 +0200
commitc78bcd5ec1f2b65a2017fb700d3a26ec657ee847 (patch)
tree5217be3fbc44c5d23c0ffe859cd3bd7db10ae1a9 /pydis_site/apps/api/models
parentAdding a tools page to the More menu (diff)
parentChanging logic so an end_reason can never be specified when updating an activ... (diff)
Merge pull request #220 from python-discord/django-api-bot-nomination-changes
Changing the way nominations work in the backend
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r--pydis_site/apps/api/models/bot/nomination.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pydis_site/apps/api/models/bot/nomination.py b/pydis_site/apps/api/models/bot/nomination.py
index 5ebb9759..8a8f4d36 100644
--- a/pydis_site/apps/api/models/bot/nomination.py
+++ b/pydis_site/apps/api/models/bot/nomination.py
@@ -11,7 +11,7 @@ class Nomination(ModelReprMixin, models.Model):
default=True,
help_text="Whether this nomination is still relevant."
)
- author = models.ForeignKey(
+ actor = models.ForeignKey(
User,
on_delete=models.CASCADE,
help_text="The staff member that nominated this user.",
@@ -20,14 +20,22 @@ class Nomination(ModelReprMixin, models.Model):
reason = models.TextField(
help_text="Why this user was nominated."
)
- user = models.OneToOneField(
+ user = models.ForeignKey(
User,
on_delete=models.CASCADE,
help_text="The nominated user.",
- primary_key=True,
related_name='nomination'
)
inserted_at = models.DateTimeField(
auto_now_add=True,
help_text="The creation date of this nomination."
)
+ end_reason = models.TextField(
+ help_text="Why the nomination was ended.",
+ default=""
+ )
+ ended_at = models.DateTimeField(
+ auto_now_add=False,
+ help_text="When the nomination was ended.",
+ null=True
+ )