Remove some irregularities in 8abfbba9

This commit is contained in:
Raphael Michel
2019-01-10 17:41:18 +01:00
parent 336a34b10b
commit a8836cbeec
3 changed files with 3 additions and 4 deletions

View File

@@ -8,8 +8,7 @@ from django.db import migrations, models
def change_refunded_to_canceled(apps, schema_editor):
Order = apps.get_model('pretixbase', 'Order')
Order.objects.filter(status='r').update(status='c', total=0)
Order.objects.filter(status='c').update(total=0)
Order.objects.filter(status='r').update(status='c')
class Migration(migrations.Migration):

View File

@@ -421,7 +421,7 @@ class Order(LockModel, LoggedModel):
return (
self.status == Order.STATUS_PENDING
or (self.status == Order.STATUS_PAID and self.total == Decimal('0.00'))
) and self.event.settings.cancel_allow_user and cancelable
) and self.event.settings.cancel_allow_user and cancelable and self.positions.exists()
@property
def is_expired_by_time(self):

View File

@@ -1173,7 +1173,7 @@ class OrderChangeManager:
return payment_sum - refund_sum
def _recalculate_total_and_payment_fee(self):
total = sum([p.price for p in self.order.positions.all() if not p.canceled]) + sum([f.value for f in self.order.fees.all()])
total = sum([p.price for p in self.order.positions.all()]) + sum([f.value for f in self.order.fees.all()])
payment_fee = Decimal('0.00')
if self.open_payment:
current_fee = Decimal('0.00')