forked from CGM_Public/pretix_original
Removed two unused model fields
This commit is contained in:
31
src/pretix/base/migrations/0028_auto_20160816_1242.py
Normal file
31
src/pretix/base/migrations/0028_auto_20160816_1242.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.7 on 2016-08-16 12:42
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pretixbase', '0027_auto_20160815_1254'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='cartposition',
|
||||
name='base_price',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='cartposition',
|
||||
name='voucher_discount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='orderposition',
|
||||
name='base_price',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='orderposition',
|
||||
name='voucher_discount',
|
||||
),
|
||||
]
|
||||
@@ -353,10 +353,6 @@ class AbstractPosition(models.Model):
|
||||
:type attendee_name: str
|
||||
:param voucher: A voucher that has been applied to this sale
|
||||
:type voucher: Voucher
|
||||
:param voucher_discount: The absolute discount granted by the applied voucher
|
||||
:type voucher_discount: decimal.Decimal
|
||||
:param base_price: The base price without any discounts applied
|
||||
:type base_price: decimal.Decimal
|
||||
"""
|
||||
item = models.ForeignKey(
|
||||
Item,
|
||||
@@ -382,12 +378,6 @@ class AbstractPosition(models.Model):
|
||||
voucher = models.ForeignKey(
|
||||
'Voucher', null=True, blank=True
|
||||
)
|
||||
voucher_discount = models.DecimalField(
|
||||
default=Decimal('0.00'), decimal_places=2, max_digits=10
|
||||
)
|
||||
base_price = models.DecimalField(
|
||||
decimal_places=2, max_digits=10, null=True, blank=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
@@ -412,13 +402,6 @@ class AbstractPosition(models.Model):
|
||||
else:
|
||||
q.answer = ""
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.voucher is None and self.base_price is None:
|
||||
self.base_price = self.price
|
||||
if self.voucher_discount != Decimal('0.00') and self.base_price is not None:
|
||||
self.price = self.base_price - self.voucher_discount
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class OrderPosition(AbstractPosition):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user