Browse Source

remove copied user db integrity error

pull/12/head
crunk 6 months ago
parent
commit
b71a694777
  1. 6
      verse/describer/describe_files.py

6
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")

Loading…
Cancel
Save