1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-04 22:40:30 +00:00

Warn instead of exception

This commit is contained in:
Mo 2022-09-10 18:26:46 +02:00
parent c78491f61c
commit 13012d6a97

View file

@ -201,16 +201,19 @@ def importFromFile(filePath: Path):
else:
# Check if columns that should not change match
if dbStudent.first_name != first_name:
raise DataBaseImportException(
f"First name {dbStudent.first_name} in the database does not match with the first name {first_name} provided in the import file for the student number {student_number}. In case the name is changed, please change it manually using the web interface first."
flash(
f'First name "{dbStudent.first_name}" in the database does not match with the first name "{first_name}" provided in the import file for the student number {student_number}.',
"warning",
)
if dbStudent.last_name != last_name:
raise DataBaseImportException(
f"Last name {dbStudent.last_name} in the database does not match with the last name {last_name} provided in the import file for the student number {student_number}. In case the name is changed, please change it manually using the web interface first."
flash(
f'Last name "{dbStudent.last_name}" in the database does not match with the last name "{last_name}" provided in the import file for the student number {student_number}.',
"warning",
)
if dbStudent.uni_email != uni_email:
raise DataBaseImportException(
f"University email {dbStudent.uni_email} in the database does not match with the university email {last_name} provided in the import file for the student number {student_number}. In case the email is changed, please change it manually using the web interface first."
flash(
f'University email "{dbStudent.uni_email}" in the database does not match with the university email "{last_name}" provided in the import file for the student number {student_number}.',
"warning",
)
dbStudent.contact_email = contact_email