1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00
AdvLabDB/advlabdb/advlabdb_independent_funs.py

17 lines
386 B
Python

# Functions not dependent on advlabdb
from flask import flash
def flashRandomPassword(password):
flash(f"Random password: {password}", category="warning")
def parse_bool(str):
str_lower = str.lower()
if str_lower == "false":
return False
elif str_lower == "true":
return True
else:
raise ValueError(f'Can not parse a bool from "{str}"')