From 908dca311ce97b9801795c156f0b52e34207d8ef Mon Sep 17 00:00:00 2001 From: Tobias Date: Mon, 21 Jan 2019 16:44:51 +1300 Subject: [PATCH] Revert mixin changes --- pinaxcon/raffle/mixins.py | 4 +--- pinaxcon/raffle/models.py | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pinaxcon/raffle/mixins.py b/pinaxcon/raffle/mixins.py index 08ceb2fd..ce0f6c4c 100644 --- a/pinaxcon/raffle/mixins.py +++ b/pinaxcon/raffle/mixins.py @@ -36,7 +36,7 @@ class RaffleMixin: yield (item['id'], list(create_ticket_numbers(item))) -class LockMixin(): +class PrizeMixin: @property def locked(self): return self._locked @@ -45,8 +45,6 @@ class LockMixin(): self.audit_events.create(user=user, reason="Unlocked") self._locked = False - -class PrizeMixin: def remove_winner(self, user): reason = "Removed winning ticket: {}".format(self.winning_ticket.id) self.audit_events.create(user=user, reason=reason) diff --git a/pinaxcon/raffle/models.py b/pinaxcon/raffle/models.py index a12633e4..bed3184d 100644 --- a/pinaxcon/raffle/models.py +++ b/pinaxcon/raffle/models.py @@ -1,6 +1,6 @@ from django.db import models -from pinaxcon.raffle.mixins import PrizeMixin, RaffleMixin, LockMixin +from pinaxcon.raffle.mixins import PrizeMixin, RaffleMixin class Raffle(RaffleMixin, models.Model): @@ -16,7 +16,7 @@ class Raffle(RaffleMixin, models.Model): return self.description -class Prize(PrizeMixin, LockMixin, models.Model): +class Prize(PrizeMixin, models.Model): """ Stores a Prize for a given :model:`pinaxcon_raffle.Raffle`. @@ -56,7 +56,7 @@ class PrizeAudit(models.Model): return self.reason -class Draw(LockMixin, models.Model): +class Draw(models.Model): """ Stores a draw for a given :model:`pinaxcon_raffle.Raffle`, along with audit fields for the creating :model:`auth.User` and the creation timestamp. @@ -69,7 +69,7 @@ class Draw(LockMixin, models.Model): return f"{self.raffle}: {self.drawn_time}" -class DrawnTicket(LockMixin, models.Model): +class DrawnTicket(models.Model): """ Stores the result of a ticket draw, along with the corresponding :model:`pinaxcon_raffle.Draw`, :model:`pinaxcon_raffle.Prize` and the