Show connector error only on debug mode

This commit is contained in:
Michel Roux 2019-12-13 10:43:01 +01:00
parent fea6339cb8
commit 558e8170da
2 changed files with 4 additions and 2 deletions

2
app.py
View File

@ -2,7 +2,7 @@ from operator import itemgetter
from flask import redirect, render_template, request, url_for
from config import app, auth, db, ADMIN_USERNAME, ADMIN_PASSWORD, APP_PORT, IS_DEBUG
from config import app, auth, db, ADMIN_USERNAME, ADMIN_PASSWORD, APP_PORT
from connectors import *
from models import AnimeFolder, AnimeTitle, DeleteForm, SearchForm, EditForm

View File

@ -10,6 +10,7 @@ from sys import platform
import requests
from bs4 import BeautifulSoup
from config import IS_DEBUG
from models import AnimeLink
@ -137,7 +138,8 @@ class Connector(ABC):
except Exception as e:
output = ''
http_code = 500
print(e)
if IS_DEBUG:
print(e)
else:
if ajax:
headers = {'X-Requested-With': 'XMLHttpRequest'}