Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add assertion error message on token creation

Krzysiek Szularza7b513bf8d77
diff --git a/registration/models.py b/registration/models.py
index 87a6ac1412..ee054cf51f 100644
--- a/registration/models.py
+++ b/registration/models.py
@@ -28,7 +28,7 @@ class UniqueTokenManager(models.Manager): # this might end up in `utils`
super(UniqueTokenManager, self).__init__()
def create(self, **kwargs):
- assert self.token_field not in kwargs
+ assert self.token_field not in kwargs, u'Token field already filled.'
for x in xrange(100):
token = get_random_string(self.token_length)
conflict_filter = {self.token_field: token}