Skip to content

Commit

Permalink
Fix issues from AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii Ivanov committed Jan 2, 2025
1 parent 8bc03c1 commit 741a774
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion taxi/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def clean_license_number(self):
):
raise forms.ValidationError(
"Ensure that license_number start with 3 UPPER"
"symbols and last 5 characters are digits"
" symbols and last 5 characters are digits"
)

return license_number
Expand Down
2 changes: 1 addition & 1 deletion taxi/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"drivers/<int:pk>/", DriverDetailView.as_view(), name="driver-detail"
),
path(
"drivers/create", DriverCreateView.as_view(), name="driver-create"
"drivers/create/", DriverCreateView.as_view(), name="driver-create"
),
path("drivers/<int:pk>/delete/",
DriverDeleteView.as_view(), name="driver-delete"),
Expand Down
2 changes: 1 addition & 1 deletion taxi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DriverCreateView(LoginRequiredMixin, generic.CreateView):
success_url = reverse_lazy("taxi:driver-list")


class DriverDeleteView(generic.DeleteView):
class DriverDeleteView(LoginRequiredMixin, generic.DeleteView):
model = Driver
success_url = reverse_lazy("taxi:driver-list")

Expand Down
1 change: 1 addition & 0 deletions templates/taxi/car_confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ <h1>Delete car?</h1>

<input type="submit" value="Yes" class="btn btn-danger">
</form>

{% endblock %}
1 change: 1 addition & 0 deletions templates/taxi/car_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ <h1>Drivers</h1>
<li>{{ driver.username }} ({{ driver.first_name }} {{ driver.last_name }})</li>
{% endfor %}
</ul>

{% endblock %}
1 change: 1 addition & 0 deletions templates/taxi/car_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ <h1>{{ object|yesno:"Update,Create" }} car</h1>

<input type="submit" value="Submit" class="btn btn-primary">
</form>

{% endblock %}
1 change: 1 addition & 0 deletions templates/taxi/car_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ <h1>
{% else %}
<p>There are no cars in taxi</p>
{% endif %}

{% endblock %}
1 change: 1 addition & 0 deletions templates/taxi/driver_confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ <h1>Delete driver?</h1>

<input type="submit" value="Yes" class="btn btn-danger">
</form>

{% endblock %}
4 changes: 2 additions & 2 deletions templates/taxi/driver_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ <h1>
<p><strong>License number:</strong> {{ driver.license_number }}</p>
<p><strong>Is staff:</strong> {{ driver.is_staff }}</p>

<a href="{% url 'taxi:driver-delete' pk=driver.id %}" class="btn btn-danger">
<a href="{% url 'taxi:driver-delete' pk=driver.pk %}" class="btn btn-danger">
Delete
</a>

<a href="{% url 'taxi:driver-update' pk=driver.id %}" class="btn btn-secondary">
<a href="{% url 'taxi:driver-update' pk=driver.pk %}" class="btn btn-secondary">
Update
</a>

Expand Down
1 change: 1 addition & 0 deletions templates/taxi/driver_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ <h1>{{ object|yesno:"Update,Create" }} driver</h1>

<input type="submit" value="Submit" class="btn btn-primary">
</form>

{% endblock %}
3 changes: 2 additions & 1 deletion templates/taxi/driver_list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}

{% block content %}
<h1>Driver List <a style="float:rigt" href="{% url 'taxi:driver-create' %}">+</a></h1>
<h1>Driver List <a style="float:right" href="{% url 'taxi:driver-create' %}">+</a></h1>

{% if driver_list %}
<table class="table">
Expand All @@ -26,4 +26,5 @@ <h1>Driver List <a style="float:rigt" href="{% url 'taxi:driver-create' %}">+</a
{% else %}
<p>There are no drivers in the service.</p>
{% endif %}

{% endblock %}
1 change: 1 addition & 0 deletions templates/taxi/driver_update_license.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ <h1>Update License</h1>

<input type="submit" value="Submit" class="btn btn-primary">
</form>

{% endblock %}

0 comments on commit 741a774

Please sign in to comment.