Ensure minimum length
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-10-02 04:21:33 +02:00
parent 9a7258cb4d
commit 9fb474d3be

View File

@ -58,7 +58,10 @@ class SampleResource(Resource):
return {'err_msg': 'Input JSON schema invalid'}, 417
xeger = Xeger(limit=30)
generated_tag = xeger.xeger(r'^[a-zA-Z]+[0-9a-zA-Z_]*$')[:32]
while True:
generated_tag = xeger.xeger(r'^[a-zA-Z]+[0-9a-zA-Z_]*$')[:32]
if len(generated_tag) > 2: # Ensure minimum length
break
record = SampleMetadata(
device_id=desc['device_id'],