summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-05-24 21:07:09 -0500
committerDan McGee <dan@archlinux.org>2010-06-08 08:35:58 -0500
commit8bf0bfeac7f1cdfee19432b3eb77c48f4fedef08 (patch)
treec47a39014eee247428dd471f1897aabdccae64c6 /devel/views.py
parentbad2825fab9f45f468414ed551bad9d987923600 (diff)
Use Sites framework instead of hardcoded domain name
Instead of putting 'www.archlinux.org' all over the place, use the Django sites framework to pull the site name out of the database. Now these amazing things will work if you are running locally and decide to change the site! Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/devel/views.py b/devel/views.py
index 298c65a1..edbe4ca3 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -2,6 +2,7 @@ from django import forms
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.models import User
+from django.contrib.sites.models import Site
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.mail import send_mail
@@ -96,13 +97,14 @@ class NewUserForm(forms.ModelForm):
user.save()
profile.user = user
profile.save()
+ domain = Site.objects.get_current().domain
send_mail("Your new archweb account",
"""You can now log into:
-https://www.archlinux.org/
+https://%s/login/
with these login details:
Username: %s
-Password: %s""" % (user.username, pw),
+Password: %s""" % (domain, user.username, pw),
'Arch Website Notification <nobody@archlinux.org>',
[user.email],
fail_silently=False)