Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Actually use the `token_field` for conflict check
Krzysiek Szularzda8651e4c105
diff --git a/registration/models.py b/registration/models.pyindex c9895c8de0..87a6ac1412 100644--- a/registration/models.py+++ b/registration/models.py@@ -31,7 +31,8 @@ class UniqueTokenManager(models.Manager): # this might end up in `utils`assert self.token_field not in kwargsfor x in xrange(100):token = get_random_string(self.token_length)- conflict = self.get_query_set().filter(token=token)+ conflict_filter = {self.token_field: token}+ conflict = self.get_query_set().filter(**conflict_filter)if not conflict.exists():kwargs[self.token_field] = tokenreturn super(UniqueTokenManager, self).create(**kwargs)