Added filename length too long check

master
d3adc0de 1 year ago
parent 701acf48f9
commit 835b3db336
  1. 2
      generator.py

@ -193,6 +193,8 @@ def validate_filename(filename):
if not filename:
filename = ""
current_length = len(filename)
if current_length > 12:
filename = filename[:12]
gap = required_length - current_length
return filename + ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(gap))

Loading…
Cancel
Save