mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-04 16:04:35 +00:00
Initial notifications draft
This commit is contained in:
@@ -260,6 +260,10 @@ mimetypes.add_type("text/xml", ".plist", False)
|
||||
|
||||
HTML_MINIFY = not localsettings.DEBUG
|
||||
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_HOST = 'localhost'
|
||||
EMAIL_PORT = 1025
|
||||
|
||||
if DEBUG:
|
||||
import mimetypes
|
||||
mimetypes.add_type("image/png", ".png", True)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
import urlparse
|
||||
from avatar.views import notification
|
||||
from notification import models as notification
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import SuspiciousOperation
|
||||
@@ -88,7 +88,13 @@ class UserProfile(_BaseModel):
|
||||
|
||||
def add_follower(self, user):
|
||||
self.followers.add(user)
|
||||
notification.send(self.user, "new_follower", {"from_user": "admin@deepsouthsounds.com"})
|
||||
try:
|
||||
notification.send([self.user], "new_follower", {"from_user": "admin@deepsouthsounds.com"})
|
||||
except Exception, ex:
|
||||
self.logger.warning("Unable to send email for new follower")
|
||||
self.logger.warning("Host: %s" % settings.EMAIL_HOST)
|
||||
self.logger.warning("Port: %s" % settings.EMAIL_PORT)
|
||||
self.logger.warning("Backend: %s" % settings.EMAIL_BACKEND)
|
||||
|
||||
def is_follower(self, user):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user