From b71a694777cd087bc42706514e6b604a296f08ac Mon Sep 17 00:00:00 2001 From: crunk Date: Tue, 28 May 2024 23:35:40 +0200 Subject: [PATCH] remove copied user db integrity error --- verse/describer/describe_files.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/verse/describer/describe_files.py b/verse/describer/describe_files.py index f980dfe..3c6da74 100644 --- a/verse/describer/describe_files.py +++ b/verse/describer/describe_files.py @@ -94,14 +94,10 @@ def save_described_file_to_db(describe_form, distribusi_file): distribusi_file.tags = describe_form.searchtags db.session.add(distribusi_file) db.session.commit() - except InvalidRequestError: + except (InvalidRequestError, IntegrityError): db.session.rollback() describe_form.save.errors.append("Something went wrong!") flash("Something went wrong!", "danger") - except IntegrityError: - db.session.rollback() - describe_form.save.errors.append("User already exists!") - flash("User already exists!", "warning") except DataError: db.session.rollback() describe_form.save.errors.append("Invalid Entry")