konova/user/models/user.py
mpeltriaux 82778d1fec # 63 Mail background sending
* moves mail sending to background using celery
2022-01-12 14:27:39 +01:00

29 lines
725 B
Python

"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 15.11.21
"""
from django.contrib.auth.models import AbstractUser
from django.db import models
from konova.utils.mailer import Mailer
class User(AbstractUser):
notifications = models.ManyToManyField("user.UserNotification", related_name="+", blank=True)
def send_mail_shared_access_removed(self, obj_identifier):
""" Sends a mail to the user in case of removed shared access
Args:
obj ():
Returns:
"""
mailer = Mailer()
mailer.send_mail_shared_access_removed(obj_identifier, self)