move checked_in field to baseticket
This commit is contained in:
parent
ac5fb77c7a
commit
6d5a7522d8
24
src/tickets/migrations/0004_auto_20170818_1303.py
Normal file
24
src/tickets/migrations/0004_auto_20170818_1303.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-08-18 11:03
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('tickets', '0003_auto_20170817_1938'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='shopticket',
|
||||
name='checked_in',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='baseticket',
|
||||
name='checked_in',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -30,6 +30,7 @@ class TicketType(CreatedUpdatedModel, UUIDModel):
|
|||
class BaseTicket(models.Model):
|
||||
qrcode_base64 = models.TextField(null=True, blank=True)
|
||||
ticket_type = models.ForeignKey('TicketType')
|
||||
checked_in = models.BooleanField(default=False)
|
||||
|
||||
def save(self, **kwargs):
|
||||
super(BaseTicket, self).save(**kwargs)
|
||||
|
@ -101,8 +102,6 @@ class ShopTicket(BaseTicket, CreatedUpdatedModel, UUIDModel):
|
|||
blank=True,
|
||||
)
|
||||
|
||||
checked_in = models.BooleanField(default=False)
|
||||
|
||||
# overwrite the _get_token method because old tickets use the user_id
|
||||
def _get_token(self):
|
||||
return hashlib.sha256(
|
||||
|
|
Loading…
Reference in a new issue