mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Remove some irregularities in 8abfbba9
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user