Skip to content

Commit

Permalink
Moved to using e-mail backends (external apps will be updated to use …
Browse files Browse the repository at this point in the history
…django.core.send_mail too)
  • Loading branch information
brosner committed Sep 10, 2010
1 parent 48cf5b4 commit b0349f6
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
6 changes: 2 additions & 4 deletions pinax/apps/account/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.encoding import smart_unicode
Expand All @@ -14,9 +15,6 @@
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models import Site

from pinax.core.utils import get_send_mail
send_mail = get_send_mail()

from emailconfirmation.models import EmailAddress
from timezones.forms import TimeZoneField

Expand Down Expand Up @@ -413,7 +411,7 @@ def save(self, **kwargs):
"temp_key": temp_key,
"domain": domain,
})
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email], priority="high")
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email])
return self.cleaned_data["email"]


Expand Down
6 changes: 2 additions & 4 deletions pinax/apps/signup_codes/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.utils.translation import ugettext_lazy as _, ugettext

from django.contrib.sites.models import Site

from pinax.core.utils import get_send_mail
send_mail = get_send_mail()

from pinax.apps.account.forms import GroupForm, SignupForm as BaseSignupForm
from pinax.apps.signup_codes.models import SignupCode, check_signup_code

Expand Down Expand Up @@ -62,4 +60,4 @@ def send_signup_code(self):
}
subject = render_to_string("signup_codes/invite_user_subject.txt", ctx)
message = render_to_string("signup_codes/invite_user.txt", ctx)
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [email], priority="high")
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [email])
17 changes: 0 additions & 17 deletions pinax/core/utils.py

This file was deleted.

2 changes: 2 additions & 0 deletions pinax/projects/account_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ACCOUNT_OPEN_SIGNUP = True
ACCOUNT_REQUIRED_EMAIL = False
ACCOUNT_EMAIL_VERIFICATION = False
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/basic_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/cms_company_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/cms_holidayhouse_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/code_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/company_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

DEBUG_TOOLBAR_CONFIG = {
"INTERCEPT_REDIRECTS": False,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/intranet_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
3 changes: 2 additions & 1 deletion pinax/projects/private_beta_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ACCOUNT_OPEN_SIGNUP = False
ACCOUNT_REQUIRED_EMAIL = False
ACCOUNT_EMAIL_VERIFICATION = False
Expand All @@ -177,7 +179,6 @@
LOGIN_URL = "/account/login/"
LOGIN_REDIRECT_URLNAME = "what_next"


EMAIL_CONFIRMATION_DAYS = 2
EMAIL_DEBUG = DEBUG

Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/sample_group_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/social_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

ABSOLUTE_URL_OVERRIDES = {
"auth.user": lambda o: "/profiles/profile/%s/" % o.username,
}
Expand Down
2 changes: 2 additions & 0 deletions pinax/projects/zero_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@

MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

EMAIL_BACKEND = "mailer.backend.DbBackend"

DEBUG_TOOLBAR_CONFIG = {
"INTERCEPT_REDIRECTS": False,
}
Expand Down

0 comments on commit b0349f6

Please sign in to comment.