-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Clemens-Dautermann
committed
Nov 16, 2021
1 parent
c7209fb
commit 09c2cc5
Showing
6 changed files
with
28 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.urls import path | ||
from task_display.views import list_tasks_as_list | ||
from task_display.views import list_tasks_as_list, redirect_to_list_view | ||
|
||
urlpatterns = [ | ||
path('tasks/list/', list_tasks_as_list), | ||
path('tasks/', redirect_to_list_view), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
from django.shortcuts import render | ||
from django.shortcuts import render, redirect | ||
from django.contrib.auth.decorators import login_required | ||
|
||
|
||
# Create your views here. | ||
@login_required | ||
def list_tasks_as_list(request): | ||
context = {'title': 'Tasklist'} | ||
context = {'title': 'Tasklist', | ||
'fullname': request.user.first_name + request.user.last_name, | ||
'email': request.user.email} | ||
return render(request, 'task_display/task_list.html', context) | ||
|
||
|
||
def redirect_to_list_view(request): | ||
return redirect('list/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
todolist_server/todolist_server/templates/task_display/task_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% extends "base/menubar.html" %} | ||
{% block title %} | ||
foo | ||
|
||
{% endblock %} |