-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D-taxi-service-authentication #807
base: master
Are you sure you want to change the base?
Conversation
taxi/urls.py
Outdated
index, | ||
CarListView, | ||
CarDetailView, | ||
DriverListView, | ||
DriverDetailView, | ||
ManufacturerListView, | ||
user_logout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't me modified at all.
You already use build-in authentification methods by including
path("accounts/", include("django.contrib.auth.urls"))
taxi/views.py
Outdated
num_visits = request.session.get("num_visits", 0) | ||
request.session["num_visits"] = num_visits + 1 | ||
|
||
request.session.save() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? this code responsible for the counter of visits
taxi/urls.py
Outdated
@@ -1,6 +1,8 @@ | |||
from argparse import Namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all changes from this file
There no need Namespace, auth_views, defining path for logout or login. Just revert all changes in this file
templates/base.html
Outdated
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-2"> | ||
{% block sidebar %} | ||
{% include "includes/sidebar.html" %} | ||
{% endblock %} | ||
</div> | ||
<div class="col-sm-10 "> | ||
{% if user.is_authenticated %} | ||
<p>Welcome, {{ user.username }}!</p> | ||
<a href="{% url 'logout' %}">Logout</a> | ||
{% else %} | ||
<a href="{% url 'taxi:login' %}">Login</a> | ||
{% endif %} | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% block pagination %} | ||
{% include "includes/pagination.html" %} | ||
{% endblock %} | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this to sidebar.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several changes were requested
templates/taxi/index.html
Outdated
<ul> | ||
<h1>Taxi Service Home</h1> | ||
<p>Welcome to Best Taxi Ever!</p> | ||
<p>You have visited this page {{ num_visits }} times.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use pluralize
to form the number of visits according to the checklist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, well done!
Login page
Home page
Logout page
Manufacturers page
Cars page
Drivers page
User page