diff --git a/settings.py b/settings.py
index 6b6eea5..b524cac 100644
--- a/settings.py
+++ b/settings.py
@@ -29,7 +29,7 @@ if 'DATABASE_URL' in os.environ:
}
ABSOLUTE_URL_OVERRIDES = {'auth.user': lambda u: "/%s/" % u.username}
-ACCOUNT_ACTIVATION_DAYS = 0
+ACCOUNT_ACTIVATION_DAYS = 14
ADMINS = (('Nick Sergeant', 'nick@snipt.net'),)
ALLOWED_HOSTS = ['*']
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
diff --git a/snipts/templates/snipts/list.html b/snipts/templates/snipts/list.html
index 54f5b1f..20f47b0 100644
--- a/snipts/templates/snipts/list.html
+++ b/snipts/templates/snipts/list.html
@@ -26,7 +26,11 @@
{% include "snipts/snipt-list.html" %}
{% empty %}
- No snipts to show here. Sorry!
+ {% if request.user == user and not request.user.is_active %}
+ Welcome! Please click the activation link in your email in order to create your first snipt.
+ {% else %}
+ No snipts to show here. Sorry!
+ {% endif %}
{% endfor %}
{% paginate %}
diff --git a/snipts/utils.py b/snipts/utils.py
index 769ea7a..dc3c062 100644
--- a/snipts/utils.py
+++ b/snipts/utils.py
@@ -22,9 +22,6 @@ def slugify_uniquely(value, model, slugfield="slug"):
def activate_user(user, request, **kwargs):
- user.is_active = True
- user.save()
-
user = authenticate(username=request.POST['username'],
password=request.POST['password1'])
login(request, user)
diff --git a/templates/add-snipt.html b/templates/add-snipt.html
index 882db0f..ea51587 100644
--- a/templates/add-snipt.html
+++ b/templates/add-snipt.html
@@ -1,8 +1,10 @@
-
- Add {% if request.user.username == 'blog' %}Post{% else %}Snipt{% endif %}
-
-
+ {% if request.user.is_active %}
+
+ Add {% if request.user.username == 'blog' %}Post{% else %}Snipt{% endif %}
+
+
+ {% endif %}
{% if request.user.profile.has_teams %}
diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt
index 40f90b4..baed765 100644
--- a/templates/registration/activation_email.txt
+++ b/templates/registration/activation_email.txt
@@ -2,6 +2,10 @@ Hey there,
Welcome to Snipt. If you ever have any thoughts or issues with the site whatsoever, please feel free to contact me directly.
+To complete your registration, please activate your account here:
+
+https://{{site.domain}}{% url 'registration_activate' activation_key %}
+
Thanks!
Nick Sergeant
diff --git a/urls.py b/urls.py
index a08a4c5..5b16f6e 100644
--- a/urls.py
+++ b/urls.py
@@ -3,7 +3,7 @@ import os
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.http import HttpResponseRedirect
-from django.views.generic import TemplateView
+from django.views.generic import RedirectView, TemplateView
from snipts.api import (PublicSniptResource,
PublicUserResource, PrivateSniptResource,
PrivateFavoriteResource, PrivateUserProfileResource,
@@ -56,6 +56,8 @@ urlpatterns = \
url(r'^register/$', lambda x: HttpResponseRedirect('/signup/')),
url(r'^signup/$', SniptRegistrationView.as_view(),
name='registration_register'),
+ url(r'^activate/complete/$', RedirectView.as_view(
+ url='/login-redirect/')),
url(r'', include('registration.backends.default.urls')),
url(r'^', include('teams.urls')),
diff --git a/utils/views.py b/utils/views.py
index 561e09a..29c8944 100644
--- a/utils/views.py
+++ b/utils/views.py
@@ -2,7 +2,7 @@ import requests
from django.conf import settings
from django.http import HttpResponse
-from registration.backends.default.views import RegistrationView
+from registration.backends.default.views import ActivationView, RegistrationView
from utils.forms import SniptRegistrationForm