diff --git a/gestioCOF/settings/common.py b/gestioCOF/settings/common.py index fc9f1def..52aaf103 100644 --- a/gestioCOF/settings/common.py +++ b/gestioCOF/settings/common.py @@ -192,7 +192,7 @@ CAS_EMAIL_FORMAT = "%s@clipper.ens.fr" AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', - 'gestion.shared.COFCASBackend', + 'gestion.backends.COFCASBackend', 'kfet.auth.backends.GenericBackend', ) diff --git a/gestion/shared.py b/gestion/shared.py deleted file mode 100644 index 39bc5da7..00000000 --- a/gestion/shared.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Locking/unlocking tools to prevent tables to be corrupted -""" - -from django.db import connection - - -def lock_table(*models): - query = "LOCK TABLES " - for i, model in enumerate(models): - table = model._meta.db_table - if i > 0: - query += ", " - query += "%s WRITE" % table - cursor = connection.cursor() - cursor.execute(query) - row = cursor.fetchone() - return row - - -def unlock_tables(*models): - cursor = connection.cursor() - cursor.execute("UNLOCK TABLES") - row = cursor.fetchone() - return row - -unlock_table = unlock_tables