Update app/models/order.py
Co-authored-by: Charlotte Van Petegem <charlotte.vanpetegem@ugent.be>
This commit is contained in:
parent
978b432d7e
commit
2bdd07c9af
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ BASE58_ALPHABET = \
|
||||||
def generate_slug():
|
def generate_slug():
|
||||||
secret = ''.join(secrets.choice(BASE58_ALPHABET) for i in range(7))
|
secret = ''.join(secrets.choice(BASE58_ALPHABET) for i in range(7))
|
||||||
while Order.query.filter(Order.slug == secret).first() is not None:
|
while Order.query.filter(Order.slug == secret).first() is not None:
|
||||||
secret = ''.join(secrets.choice(alphabet) for i in range(7))
|
secret = ''.join(secrets.choice(BASE58_ALPHABET) for i in range(7))
|
||||||
return secret
|
return secret
|
||||||
|
|
||||||
class Order(db.Model):
|
class Order(db.Model):
|
||||||
|
|
Loading…
Reference in a new issue