From 87447e56f8cf234732ce4bc5dfe607556c49f4e1 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 16 Feb 2016 16:20:23 +0100 Subject: [PATCH 1/2] Use django's API... see #835 --- modoboa/core/views/admin.py | 1 - modoboa/lib/db_utils.py | 20 +++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/modoboa/core/views/admin.py b/modoboa/core/views/admin.py index 56d0b19df..9d1fc83b6 100644 --- a/modoboa/core/views/admin.py +++ b/modoboa/core/views/admin.py @@ -8,7 +8,6 @@ from django.shortcuts import render from django.template.loader import render_to_string from django.utils.translation import ugettext as _ -from modoboa.core.extensions import exts_pool from modoboa.core.models import Log from modoboa.core.utils import check_for_updates from modoboa.lib import events, parameters diff --git a/modoboa/lib/db_utils.py b/modoboa/lib/db_utils.py index 156fc5077..42c8dd55f 100644 --- a/modoboa/lib/db_utils.py +++ b/modoboa/lib/db_utils.py @@ -7,23 +7,9 @@ from django.utils.translation import ugettext as _ from modoboa.lib.exceptions import InternalError -def db_table_exists(table, cursor=None): - """Check if table exists - - Taken from here: - https://gist.github.com/527113/307c2dec09ceeb647b8fa1d6d49591f3352cb034 - - """ - try: - if not cursor: - cursor = connection.cursor() - if not cursor: - raise Exception - table_names = connection.introspection.get_table_list(cursor) - except: - raise Exception("unable to determine if the table '%s' exists" % table) - else: - return table in table_names +def db_table_exists(table): + """Check if table exists.""" + return table in connection.introspection.table_names() def db_type(cname="default"): From 32acc9a3d9d9f6e2318985c88cb3ff6cbf56b3ea Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Mon, 22 Feb 2016 09:35:08 +0100 Subject: [PATCH 2/2] Release 1.4.4 --- doc/conf.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 201710aad..7837ec9db 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -52,7 +52,7 @@ copyright = u'2015, Antoine Nguyen' # The short X.Y version. version = '1.4' # The full version, including alpha/beta/rc tags. -release = '1.4.3' +release = '1.4.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index b2da720f2..1bced22b9 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def read(fname): setup( name="modoboa", - version='1.4.3', + version='1.4.4', url='http://modoboa.org/', license='MIT', description="Mail hosting made simple",