update predavanja

This commit is contained in:
msinkec
2021-06-11 12:57:50 +02:00
parent 169e98bf32
commit d2e3fd1117
3 changed files with 11 additions and 7 deletions

View File

@@ -124,13 +124,17 @@ class UploadHandlerPredavanja(UploadHandler):
for keyword in keywords.split(','):
keyword = keyword.strip()
if keyword.isspace() or not keyword.isalpha():
if keyword.isspace() or not keyword.replace(' ', '').isalpha():
return 'Ključna beseda "{}" ni pravilnega formata.'.format(keyword)
if not re.search(REGEX_EMAIL, email):
return 'Email napačnega formata.'
for key, val in form.items():
if len(val) > MAXLEN_FORM:
return 'Polje "{}" presega dolžino {} znakov.'.format(key, MAXLEN_FORM)
if key == 'kljucne-besde':
if len(val) > 500:
return 'Polje "{}" presega dolžino {} znakov.'.format(key, 500)
else:
if len(val) > MAXLEN_FORM:
return 'Polje "{}" presega dolžino {} znakov.'.format(key, MAXLEN_FORM)