Browse Source

Auth stuff.

master
Nick Sergeant 5 years ago
parent
commit
fdc108aa98
8 changed files with 6 additions and 34 deletions
  1. +0
    -1
      blogs/views.py
  2. +2
    -2
      settings.py
  3. +1
    -1
      snipts/views.py
  4. +1
    -1
      teams/views.py
  5. +1
    -11
      templates/registration/activation_email.txt
  6. +1
    -1
      templates/registration/registration_complete.html
  7. +0
    -15
      utils/views.py
  8. +0
    -2
      views.py

+ 0
- 1
blogs/views.py View File

@@ -2,7 +2,6 @@ import datetime

from annoying.functions import get_object_or_None
from django.shortcuts import get_object_or_404, render
from django.template import RequestContext
from snipts.models import Snipt

THEME_CHOICES = {


+ 2
- 2
settings.py View File

@@ -37,7 +37,7 @@ AUTH_PROFILE_MODULE = 'accounts.UserProfile'
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
BASE_PATH = os.path.dirname(__file__)
DEBUG = True if 'DEBUG' in os.environ else False
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_EMAIL', 'snipt@localhost')
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_EMAIL', 'support@snipt.net')
EMAIL_BACKEND = 'postmark.django_backend.EmailBackend'
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
INTERNAL_IPS = ('127.0.0.1',)
@@ -65,7 +65,7 @@ ROOT_URLCONF = 'urls'
SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme')
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SEND_BROKEN_LINK_EMAILS = False
SERVER_EMAIL = os.environ.get('POSTMARK_EMAIL', 'snipt@localhost')
SERVER_EMAIL = os.environ.get('POSTMARK_EMAIL', 'support@snipt.net')
SESSION_COOKIE_AGE = 15801100
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
SITE_ID = 1


+ 1
- 1
snipts/views.py View File

@@ -102,7 +102,7 @@ def report_spam(request, snipt_id):
User: https://snipt.net/admin/auth/user/{}/delete/
Reporter: https://snipt.net/{}/
""".format(snipt.id, snipt.user.id, request.user.username),
os.environ.get('POSTMARK_EMAIL', 'snipt@localhost'),
os.environ.get('POSTMARK_EMAIL', 'support@snipt.net'),
['nick@snipt.net'],
fail_silently=False)



+ 1
- 1
teams/views.py View File

@@ -42,7 +42,7 @@ def for_teams_complete(request):
Team: https://snipt.net/{}
Email: {}
""".format(team.slug, team.email),
os.environ.get('POSTMARK_EMAIL', 'snipt@localhost'),
os.environ.get('POSTMARK_EMAIL', 'support@snipt.net'),
['nick@snipt.net'],
fail_silently=False)



+ 1
- 11
templates/registration/activation_email.txt View File

@@ -1,11 +1 @@
Hey there,

Welcome to Snipt. If you ever have any thoughts or issues with the site whatsoever, please feel free to contact me directly.

Thanks!

Nick Sergeant
https://twitter.com/nicksergeant
https://twitter.com/snipt
nick@snipt.net
https://snipt.net
Welcome to Snipt!

+ 1
- 1
templates/registration/registration_complete.html View File

@@ -7,7 +7,7 @@
{% block content %}
<div class="static-box">
<div class="alert alert-info alert-alone">
Signup complete! You're now logged in. Go <a href="/{{ request.user.username }}/">home</a>, perhaps?
Signup complete! You're now logged in. Go <a href="/login-redirect/">home</a>, perhaps?
</div>
</div>
{% endblock %}

+ 0
- 15
utils/views.py View File

@@ -1,15 +0,0 @@
from registration.backends.default.views import RegistrationView
from utils.forms import SniptRegistrationForm


class SniptRegistrationView(RegistrationView):
"""
Custom registration view that uses our custom form.
"""
form_class = SniptRegistrationForm

def dispatch(self, request, *args, **kwargs):
return super(RegistrationView, self).dispatch(request, *args, **kwargs)

def get_success_url(self, request, user):
return '/account/activate/'

+ 0
- 2
views.py View File

@@ -6,8 +6,6 @@ from blogs.views import blog_list
from django.contrib.auth.models import User
from django.db.models import Count
from django.http import HttpResponseRedirect, HttpResponseBadRequest
from django.shortcuts import render
from django.template import RequestContext
from snipts.models import Snipt
from snipts.utils import get_lexers_list
from taggit.models import Tag


Loading…
Cancel
Save