diff --git a/taxi/forms.py b/taxi/forms.py index e411b644..016b3c44 100644 --- a/taxi/forms.py +++ b/taxi/forms.py @@ -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 diff --git a/taxi/urls.py b/taxi/urls.py index 9a6f9634..f5584331 100644 --- a/taxi/urls.py +++ b/taxi/urls.py @@ -53,7 +53,7 @@ "drivers//", 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//delete/", DriverDeleteView.as_view(), name="driver-delete"), diff --git a/taxi/views.py b/taxi/views.py index 0e65dfe1..c27c66b0 100644 --- a/taxi/views.py +++ b/taxi/views.py @@ -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") diff --git a/templates/taxi/car_confirm_delete.html b/templates/taxi/car_confirm_delete.html index ed996b50..39f0b468 100644 --- a/templates/taxi/car_confirm_delete.html +++ b/templates/taxi/car_confirm_delete.html @@ -7,4 +7,5 @@

Delete car?

+ {% endblock %} diff --git a/templates/taxi/car_detail.html b/templates/taxi/car_detail.html index c20da625..df91270a 100644 --- a/templates/taxi/car_detail.html +++ b/templates/taxi/car_detail.html @@ -27,4 +27,5 @@

Drivers

  • {{ driver.username }} ({{ driver.first_name }} {{ driver.last_name }})
  • {% endfor %} + {% endblock %} diff --git a/templates/taxi/car_form.html b/templates/taxi/car_form.html index b5381956..aa6fc0e7 100644 --- a/templates/taxi/car_form.html +++ b/templates/taxi/car_form.html @@ -9,4 +9,5 @@

    {{ object|yesno:"Update,Create" }} car

    + {% endblock %} diff --git a/templates/taxi/car_list.html b/templates/taxi/car_list.html index 75d1c641..acbfc06d 100644 --- a/templates/taxi/car_list.html +++ b/templates/taxi/car_list.html @@ -19,4 +19,5 @@

    {% else %}

    There are no cars in taxi

    {% endif %} + {% endblock %} diff --git a/templates/taxi/driver_confirm_delete.html b/templates/taxi/driver_confirm_delete.html index f0c17784..8fdd69a1 100644 --- a/templates/taxi/driver_confirm_delete.html +++ b/templates/taxi/driver_confirm_delete.html @@ -7,4 +7,5 @@

    Delete driver?

    + {% endblock %} diff --git a/templates/taxi/driver_detail.html b/templates/taxi/driver_detail.html index 5f39545c..7268136a 100644 --- a/templates/taxi/driver_detail.html +++ b/templates/taxi/driver_detail.html @@ -10,11 +10,11 @@

    License number: {{ driver.license_number }}

    Is staff: {{ driver.is_staff }}

    - + Delete - + Update diff --git a/templates/taxi/driver_form.html b/templates/taxi/driver_form.html index fd233177..5632805e 100644 --- a/templates/taxi/driver_form.html +++ b/templates/taxi/driver_form.html @@ -9,4 +9,5 @@

    {{ object|yesno:"Update,Create" }} driver

    + {% endblock %} diff --git a/templates/taxi/driver_list.html b/templates/taxi/driver_list.html index 5d2d76a2..2d3bd921 100644 --- a/templates/taxi/driver_list.html +++ b/templates/taxi/driver_list.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -

    Driver List +

    +

    Driver List +

    {% if driver_list %} @@ -26,4 +26,5 @@

    Driver List +There are no drivers in the service.

    {% endif %} + {% endblock %} diff --git a/templates/taxi/driver_update_license.html b/templates/taxi/driver_update_license.html index a6eaf67d..dac09509 100644 --- a/templates/taxi/driver_update_license.html +++ b/templates/taxi/driver_update_license.html @@ -9,4 +9,5 @@

    Update License

    + {% endblock %}