mirror of
https://github.com/pretix/pretix.git
synced 2025-12-14 13:32:28 +00:00
Compare commits
3 Commits
plaintext-
...
fix-datasy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6baf11c6d | ||
|
|
cfbe00d24d | ||
|
|
22f351cb89 |
@@ -391,7 +391,7 @@ class OutboundSyncProvider:
|
|||||||
def sync_order(self, order):
|
def sync_order(self, order):
|
||||||
if not self.should_sync_order(order):
|
if not self.should_sync_order(order):
|
||||||
logger.debug("Skipping order %r", order)
|
logger.debug("Skipping order %r", order)
|
||||||
return
|
return {}
|
||||||
|
|
||||||
logger.debug("Syncing order %r", order)
|
logger.debug("Syncing order %r", order)
|
||||||
positions = list(
|
positions = list(
|
||||||
|
|||||||
@@ -2825,7 +2825,7 @@ class OrderChangeManager:
|
|||||||
def _check_complete_cancel(self):
|
def _check_complete_cancel(self):
|
||||||
current = self.order.positions.count()
|
current = self.order.positions.count()
|
||||||
cancels = sum([
|
cancels = sum([
|
||||||
1 + o.position.addons.count() for o in self._operations if isinstance(o, self.CancelOperation)
|
1 + o.position.addons.filter(canceled=False).count() for o in self._operations if isinstance(o, self.CancelOperation)
|
||||||
]) + len([
|
]) + len([
|
||||||
o for o in self._operations if isinstance(o, self.SplitOperation)
|
o for o in self._operations if isinstance(o, self.SplitOperation)
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -327,6 +327,26 @@ def test_enqueue_order_twice(event):
|
|||||||
SimpleOrderSync.enqueue_order(order, 'testcase_2nd')
|
SimpleOrderSync.enqueue_order(order, 'testcase_2nd')
|
||||||
|
|
||||||
|
|
||||||
|
class DoNothingSync(SimpleOrderSync):
|
||||||
|
|
||||||
|
def should_sync_order(self, order):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_should_not_sync(event):
|
||||||
|
_register_with_fake_plugin_name(datasync_providers, DoNothingSync, 'testplugin')
|
||||||
|
|
||||||
|
DoNothingSync.fake_api_client = FakeSyncAPI()
|
||||||
|
|
||||||
|
for order in event.orders.order_by("code").all():
|
||||||
|
DoNothingSync.enqueue_order(order, 'testcase')
|
||||||
|
|
||||||
|
sync_all()
|
||||||
|
|
||||||
|
assert DoNothingSync.fake_api_client.fake_database == {}
|
||||||
|
|
||||||
|
|
||||||
StaticMappingWithAssociations = namedtuple('StaticMappingWithAssociations', (
|
StaticMappingWithAssociations = namedtuple('StaticMappingWithAssociations', (
|
||||||
'id', 'pretix_model', 'external_object_type', 'pretix_id_field', 'external_id_field', 'property_mappings', 'association_mappings'
|
'id', 'pretix_model', 'external_object_type', 'pretix_id_field', 'external_id_field', 'property_mappings', 'association_mappings'
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user