Coverage for api/proscai/utils.py: 23%
11 statements
« prev ^ index » next coverage.py v6.4.4, created at 2024-08-08 08:36 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2024-08-08 08:36 -0600
1from base.utils import id_generator
4def generate_random_slug(size=5):
5 from apps.proxy_models.models import Client
6 while True:
7 slug = id_generator(size=size)
8 others = Client.objects.filter(clicod=slug)
9 if others.count() == 0:
10 return slug
11 break
13def get_next_clicod():
14 result = 'U'+generate_random_slug()
15 return result