mirror of
https://github.com/Steffo99/estus.git
synced 2024-11-24 16:44:19 +00:00
Fix exception handling
This commit is contained in:
parent
25468ee0ac
commit
a46bfa05c6
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from flask import Flask, session, url_for, redirect, request, render_template, abort
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
import bcrypt
|
||||
|
||||
app = Flask(__name__)
|
||||
|
@ -612,7 +612,7 @@ if __name__ == "__main__":
|
|||
secondary_dns="0.0.0.0")
|
||||
db.session.add(retenulla)
|
||||
db.session.commit()
|
||||
except OperationalError:
|
||||
except IntegrityError:
|
||||
# Se queste operazioni sono già state compiute in precedenza, annullale
|
||||
db.session.rollback()
|
||||
# Esegui il sito in modalità debug
|
||||
|
|
Loading…
Reference in a new issue