Revert mixin changes

This commit is contained in:
Tobias 2019-01-21 16:44:51 +13:00
parent 30e8d95811
commit 908dca311c
2 changed files with 5 additions and 7 deletions

View file

@ -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)

View file

@ -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