Vereinfachung Membership ist nun ein custom login model, keine Abhängikeiten mehr zu auth.User.
absofort können alle Benutzer ins Ranking eingetragen werden und nicht mehr nur "zahlende Mitglieder".
This commit is contained in:
committed by
Christian Berg
parent
37d3cb78c1
commit
617b7131fe
@@ -1,11 +1,13 @@
|
||||
import logging
|
||||
|
||||
from django.core import mail
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sites.models import Site
|
||||
from django.conf import settings
|
||||
from django.template import loader, Context
|
||||
|
||||
|
||||
USER_MODEL = settings.AUTH_USER_MODEL
|
||||
|
||||
class MassMailer(object):
|
||||
"""
|
||||
This Class will send E-Mails via an SMTP Connection to multiple recipients.
|
||||
@@ -43,14 +45,14 @@ class MassMailer(object):
|
||||
self.log.debug("closed the SMTP connection. I'm done")
|
||||
|
||||
def add_recipient(self, recipient):
|
||||
if isinstance(recipient, User):
|
||||
if isinstance(recipient, USER_MODEL):
|
||||
self.recipients.add(recipient)
|
||||
else:
|
||||
self.log.warn('%s is not a User Object!', recipient)
|
||||
|
||||
def add_recipients(self, user_list):
|
||||
for user in user_list:
|
||||
if isinstance(user, User):
|
||||
if isinstance(user, USER_MODEL):
|
||||
self.log.debug('Adding %s as Recipient' % user)
|
||||
self.recipients.add(user)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user