1
Fork 0
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:
Steffo 2017-09-12 11:41:13 +02:00
parent 25468ee0ac
commit a46bfa05c6

View file

@ -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