-
Notifications
You must be signed in to change notification settings - Fork 888
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
Solution #938
base: master
Are you sure you want to change the base?
Solution #938
Conversation
bodiakof
commented
Jan 26, 2025
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.
Great job on implementing the task! 🎉 While there are a few minor issues related to code style and consistency, such as using single quotes in template tags and ensuring proper import formatting, these do not impact the core functionality of your code. Keep up the good work, and consider addressing these minor points to enhance code readability and maintainability in the future. Well done! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -1,12 +1,17 @@ | |||
from django.contrib.auth.decorators import login_required |
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.
The import statement for login_required
should be on a separate line to adhere to PEP 8 guidelines. Consider splitting this line into two separate import statements for better readability.
@@ -22,4 +23,5 @@ | |||
urlpatterns = [ | |||
path("admin/", admin.site.urls), | |||
path("", include("taxi.urls", namespace="taxi")), |
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.
The include
function is used with a namespace
argument, but the taxi
app's urls.py
file must define an app_name
variable for this to work correctly. Ensure that the taxi/urls.py
file includes an app_name
variable set to 'taxi'.
<li>User: {{ user.username }}</li> | ||
<li><a href="{% url 'logout' %}">Logout</a></li> | ||
{% else %} | ||
<li><a href="{% url 'login' %}">Login</a></li> |
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.
For consistency, consider using single quotes for the url
template tag, as it is used in other parts of the template. This helps maintain a consistent coding style throughout the template.
<p style="color: red">Invalid credentials</p> | ||
{% endif %} | ||
|
||
<form method="post" action="{% url 'login' %}"> |
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.
The form action URL uses the url
template tag with the 'login' view. Ensure that the URL name 'login' corresponds to the correct URL pattern in your urls.py
file. If the default Django authentication URLs are used, this should be correct.
@@ -4,10 +4,14 @@ | |||
<h1>Driver list</h1> | |||
{% if driver_list %} | |||
<ul> | |||
{% for driver in driver_list%} | |||
{% for driver in driver_list %} | |||
<li> | |||
<a href="{% url "taxi:driver-detail" pk=driver.id %}">{{ driver.username }}</a> |
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.
For consistency, consider using single quotes for the url
template tag, as it is a common convention in Django templates. This helps maintain a consistent coding style throughout the template.