Add DatabaseWarning to tag SQLite use warning
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
* Switch to full app paths.
|
* Switch to full app paths.
|
||||||
* Split document app models into separate modules.
|
* Split document app models into separate modules.
|
||||||
* Split workflow views into separate modules.
|
* Split workflow views into separate modules.
|
||||||
|
* Add custom DatabaseWarning to tag the SQLite usage warning.
|
||||||
|
|
||||||
3.1.11 (2019-04-XX)
|
3.1.11 (2019-04-XX)
|
||||||
===================
|
===================
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ from .settings import (
|
|||||||
from .signals import pre_initial_setup, pre_upgrade
|
from .signals import pre_initial_setup, pre_upgrade
|
||||||
from .tasks import task_delete_stale_uploads # NOQA - Force task registration
|
from .tasks import task_delete_stale_uploads # NOQA - Force task registration
|
||||||
from .utils import check_for_sqlite
|
from .utils import check_for_sqlite
|
||||||
|
from .warnings import DatabaseWarning
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -89,7 +90,9 @@ class CommonApp(MayanAppConfig):
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
super(CommonApp, self).ready()
|
super(CommonApp, self).ready()
|
||||||
if check_for_sqlite():
|
if check_for_sqlite():
|
||||||
warnings.warn(force_text(MESSAGE_SQLITE_WARNING))
|
warnings.warn(
|
||||||
|
category=DatabaseWarning, message=force_text(MESSAGE_SQLITE_WARNING)
|
||||||
|
)
|
||||||
|
|
||||||
Template(
|
Template(
|
||||||
name='main_menu', template_name='appearance/main_menu.html'
|
name='main_menu', template_name='appearance/main_menu.html'
|
||||||
|
|||||||
7
mayan/apps/common/warnings.py
Normal file
7
mayan/apps/common/warnings.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
|
class DatabaseWarning(UserWarning):
|
||||||
|
"""
|
||||||
|
Warning when using unsupported database backends
|
||||||
|
"""
|
||||||
Reference in New Issue
Block a user