Unverified Commit 72bb1486 authored by Johannes Tomren Røsvik's avatar Johannes Tomren Røsvik
Browse files

String literals should not be duplicated

parent 2340617e
Pipeline #79920 passed with stage
in 1 minute and 16 seconds
......@@ -6,6 +6,8 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
LOGIN_PAGE = '/user/login'
def projects(request):
projects = Project.objects.all()
project_categories = ProjectCategory.objects.all()
......@@ -173,7 +175,7 @@ def upload_file_to_task(request, project_id, task_id):
'task_file_form': task_file_form,
}
)
return redirect('/user/login') # Redirects to /user/login
return redirect(LOGIN_PAGE) # Redirects to /user/login
def get_user_task_permissions(user, task):
......@@ -221,7 +223,7 @@ def task_view(request, project_id, task_id):
user_permissions = get_user_task_permissions(request.user, task)
if not user_permissions['read'] and not user_permissions['write'] and not user_permissions['modify'] and not user_permissions['owner'] and not user_permissions['view_task']:
return redirect('/user/login')
return redirect(LOGIN_PAGE)
if (request.method == 'POST' and 'delivery' in request.POST and
......@@ -322,7 +324,7 @@ def task_view(request, project_id, task_id):
'per': per
})
return redirect('/user/login')
return redirect(LOGIN_PAGE)
@login_required
def task_permissions(request, project_id, task_id):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment