Skip to content

Commit

Permalink
Solution 11.12.2024/3
Browse files Browse the repository at this point in the history
  • Loading branch information
Viva1-ua committed Dec 12, 2024
1 parent f90c57b commit 51faf96
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion taxi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def index(request):
"num_drivers": num_drivers,
"num_cars": num_cars,
"num_manufacturers": num_manufacturers,
"num_visits": num_visits,
"num_visits": num_visits + 1,
}

return render(request, "taxi/index.html", context=context)
Expand Down
2 changes: 1 addition & 1 deletion taxi_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

STATIC_ROOT = BASE_DIR / "staticfiles"

LOGIN_REDIRECT_URL = "/taxi/"
LOGIN_REDIRECT_URL = "/"

# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
Expand Down
6 changes: 3 additions & 3 deletions templates/includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<ul class="sidebar-nav">
{% if user.is_authenticated %}
<li>
User: {{ user.username }}
{{ user.username }}
</li>
<li>
<a href="{% url "logout" %}">Log out</a>
<a href="{% url "logout" %}">Logout</a>
</li>
{% else %}
<li><a href="{% url "login" %}">Log in</a></li>
<li><a href="{% url "login" %}">Login</a></li>
{% endif %}
<br>
<li><a href="{% url "taxi:index" %}">Home page</a></li>
Expand Down
2 changes: 1 addition & 1 deletion templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content %}
<h1>Login</h1>
{% if form.error %}
{% if form.errors %}
<p>Invalid credentials</p>
{% endif %}
<form action="{% url "login" %}" method="post">
Expand Down
2 changes: 1 addition & 1 deletion templates/registration/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

{% block content %}
<p>Logged Out</p>
<a href="{% url "logout" %}">Click here to log in again.</a>
<a href="{% url "login" %}">Click here to log in again.</a>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/taxi/driver_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ <h1>Driver list</h1>
<li>
<a href="{% url "taxi:driver-detail" pk=driver.id %}">{{ driver.username }}</a>
({{ driver.first_name }} {{ driver.last_name }})
</li>
{% if driver.username == user.username %}
(Me)
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
Expand Down

0 comments on commit 51faf96

Please sign in to comment.