Add a UUID to projects

This commit is contained in:
Veronica Berglyd Olsen
2022-11-05 17:03:45 +01:00
parent 8b4dac4e13
commit c6d3f680cc
22 changed files with 91 additions and 40 deletions
+10
View File
@@ -25,6 +25,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
import os
import json
import uuid
import hashlib
import logging
@@ -113,6 +114,15 @@ def checkHandle(value, default, allowNone=False):
return default
def checkUuid(value, default):
"""Try to process a value as an uuid, or return a default.
"""
try:
return str(uuid.UUID(value))
except Exception:
return default
# =============================================================================================== #
# Validator Functions
# =============================================================================================== #