forked from CGM_Public/pretix_original
Make order codes organizer-unique
This commit is contained in:
@@ -229,7 +229,7 @@ class Order(LoggedModel):
|
|||||||
charset = list('ABCDEFGHJKLMNPQRSTUVWXYZ3789')
|
charset = list('ABCDEFGHJKLMNPQRSTUVWXYZ3789')
|
||||||
while True:
|
while True:
|
||||||
code = get_random_string(length=settings.ENTROPY['order_code'], allowed_chars=charset)
|
code = get_random_string(length=settings.ENTROPY['order_code'], allowed_chars=charset)
|
||||||
if not Order.objects.filter(event=self.event, code=code).exists():
|
if not Order.objects.filter(event__organizer=self.event.organizer, code=code).exists():
|
||||||
self.code = code
|
self.code = code
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user