From 91504e968878c48d6e40d0704f41f90b4437f1aa Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Sun, 19 Apr 2020 20:11:38 +0200 Subject: [PATCH] Fix circular import of utils --- tickets/models.py | 4 ++-- users/models.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tickets/models.py b/tickets/models.py index 5b74248c..17736978 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -5,7 +5,7 @@ from django.db.models.signals import post_save from django.dispatch import receiver from re2o.mixins import AclMixin -from re2o.utils import send_mail +import re2o.utils from preferences.models import GeneralOption @@ -64,7 +64,7 @@ class Ticket(AclMixin, models.Model): obj = "New ticket opened" template = loader.get_template("tickets/publication_mail_en") - send_mail( + re2o.utils.send_mail( request, obj, template.render(context), diff --git a/users/models.py b/users/models.py index 55acd051..9fb6a4b8 100755 --- a/users/models.py +++ b/users/models.py @@ -83,7 +83,7 @@ from re2o.settings import LDAP, GID_RANGES, UID_RANGES from re2o.field_permissions import FieldPermissionModelMixin from re2o.mixins import AclMixin, RevMixin from re2o.base import smtp_check -from re2o.utils import send_mail +import re2o.utils from cotisations.models import Cotisation, Facture, Paiement, Vente from machines.models import Domain, Interface, Machine, regen @@ -763,7 +763,7 @@ class User( "pseudo": self.pseudo, } - send_mail( + re2o.utils.send_mail( request, "Bienvenue au %(name)s / Welcome to %(name)s" % {"name": AssoOption.get_cached_value("name")}, @@ -792,7 +792,7 @@ class User( "expire_in": str(GeneralOption.get_cached_value("req_expire_hrs")), } - send_mail( + re2o.utils.send_mail( request, "Changement de mot de passe de %(name)s / Password change for " "%(name)s" % {"name": AssoOption.get_cached_value("name")}, @@ -877,7 +877,7 @@ class User( "confirm_before_en": self.confirm_email_before_date().strftime("%Y-%m-%d"), } - send_mail( + re2o.utils.send_mail( request, "Confirmation du mail de %(name)s / Email confirmation for " "%(name)s" % {"name": AssoOption.get_cached_value("name")}, @@ -933,7 +933,7 @@ class User( "pseudo": self.pseudo, } - send_mail( + re2o.utils.send_mail( None, "Ajout automatique d'une machine / New machine autoregistered", "", @@ -953,7 +953,7 @@ class User( "site_name": GeneralOption.get_cached_value("site_name"), } - send_mail( + re2o.utils.send_mail( request, "Suspension automatique / Automatic suspension", template.render(context), @@ -1765,7 +1765,7 @@ class Ban(RevMixin, AclMixin, models.Model): "asso_name": AssoOption.get_cached_value("name"), } - send_mail( + re2o.utils.send_mail( request, "Déconnexion disciplinaire / Disciplinary disconnection", template.render(context),