Skip to content
Snippets Groups Projects
Commit cfd0e7ee authored by Christian Dresen's avatar Christian Dresen
Browse files

[WarpInfra] Fixed last Commit

parent b6b22b5a
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ from warpauth.util import *
from django.utils.translation import ugettext as _
from django.core.exceptions import ObjectDoesNotExist
from warpzone.settings import INSTANCE_NAME
from django.shortcuts import redirect
def send_token(token):
email_content = _("https://infra.warpzone.ms/account/registration/activate/%(token)s") % {'token': token.token }
......@@ -21,7 +22,7 @@ def send_token(token):
def register(request):
page_context['success'] = False
if "INTERN" in INSTANCE_NAME:
return redirect('http://infra.warpzone.ms/registration/')
return redirect('http://infra.warpzone.ms/account/registration/')
if request.method == "POST":
username = request.POST['username']
......@@ -75,6 +76,8 @@ def register(request):
def activate(request, token=None):
if "INTERN" in INSTANCE_NAME:
return redirect('http://infra.warpzone.ms/account/registration/')
try:
activation_token = ActivationToken.objects.get(token=token)
group = LdapGroup.objects.filter(name="active").get()
......@@ -87,6 +90,8 @@ def activate(request, token=None):
return HttpResponse(render(request, 'warpauth/register/activate.html', page_context))
def resend_token(request):
if "INTERN" in INSTANCE_NAME:
return redirect('http://infra.warpzone.ms/account/registration/')
if request.method == "POST":
try:
token = ActivationToken.objects.get(user=request.POST["username"])
......
......@@ -13,7 +13,7 @@ from warpzone.util import send_email
from warpauth.util import *
from warpauth.models import PasswordResetToken, LdapUser
from django.shortcuts import redirect
from warpzone.settings import PW_RESET_TOKEN_LIFETIME, INSTANCE_NAME
#
......@@ -22,7 +22,7 @@ from warpzone.settings import PW_RESET_TOKEN_LIFETIME, INSTANCE_NAME
def gen_token(request):
if "INTERN" in INSTANCE_NAME:
return redirect('http://infra.warpzone.ms/reset_password/')
return redirect('http://infra.warpzone.ms/account/reset_password/')
if request.POST:
try:
......@@ -49,7 +49,7 @@ def gen_token(request):
def change_password(request, reset_hash=None):
if "INTERN" in INSTANCE_NAME:
return redirect('http://infra.warpzone.ms/reset_password/')
return redirect('http://infra.warpzone.ms/account/reset_password/')
try:
pw_reset_token = PasswordResetToken.objects.get(hash=reset_hash)
time_difference = datetime.datetime.now() - pw_reset_token.created
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment