# 63 Refactoring
* refactors django User model to custom User model to provide further attributes and methods directly on the user model
This commit is contained in:
28
user/models/user.py
Normal file
28
user/models/user.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
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):
|
||||
""" Sends a mail to the user in case of removed shared access
|
||||
|
||||
Args:
|
||||
obj ():
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
mailer = Mailer()
|
||||
mailer.send_mail_shared_access_removed(obj, self)
|
||||
Reference in New Issue
Block a user