Add custom DatabaseWarning
This warning is used to categorize the SQLite production usage warning. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -41,6 +41,7 @@ from .settings import (
|
||||
from .signals import pre_initial_setup, pre_upgrade
|
||||
from .tasks import task_delete_stale_uploads # NOQA - Force task registration
|
||||
from .utils import check_for_sqlite
|
||||
from .warnings import DatabaseWarning
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -88,7 +89,9 @@ class CommonApp(MayanAppConfig):
|
||||
def ready(self):
|
||||
super(CommonApp, self).ready()
|
||||
if check_for_sqlite():
|
||||
warnings.warn(force_text(MESSAGE_SQLITE_WARNING))
|
||||
warnings.warn(
|
||||
category=DatabaseWarning, message=force_text(MESSAGE_SQLITE_WARNING)
|
||||
)
|
||||
|
||||
Template(
|
||||
name='menu_main', template_name='appearance/menu_main.html'
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
class DatabaseWarning(UserWarning):
|
||||
"""
|
||||
Warning when using unsupported database backends
|
||||
"""
|
||||
|
||||
|
||||
class InterfaceWarning(UserWarning):
|
||||
"""
|
||||
Warning when using obsolete internal interfaces
|
||||
|
||||
Reference in New Issue
Block a user