mirror of
https://github.com/pretix/pretix.git
synced 2026-08-28 13:34:40 +00:00
API: Allow to simulate check-ins (#6360)
* API: Allow to simulate check-ins * Add missing file
This commit is contained in:
@@ -288,6 +288,15 @@ def get_deterministic_ordering(model, ordering):
|
||||
return ordering
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def conditional_atomic(do_atomic, **kwargs):
|
||||
if do_atomic:
|
||||
with transaction.atomic(**kwargs):
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
|
||||
|
||||
class IgnoreOnSQLiteMixin:
|
||||
# Mixin to allow defining PostgreSQL-specific indexes that will just not be created
|
||||
# on SQLite. SQLite is supported for testing only anyways!
|
||||
|
||||
Reference in New Issue
Block a user