From 256411dd81c43f494787ba73ae80690a4fdd9cf9 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Tue, 21 Jan 2020 19:03:07 +0100
Subject: [PATCH] Rename properties and views with unfortunate namings

---
 aleksis/apps/chronos/models.py                            | 2 +-
 aleksis/apps/chronos/templates/chronos/substitutions.html | 2 +-
 aleksis/apps/chronos/urls.py                              | 2 +-
 aleksis/apps/chronos/views.py                             | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/aleksis/apps/chronos/models.py b/aleksis/apps/chronos/models.py
index ed06b1e5..293b62ba 100644
--- a/aleksis/apps/chronos/models.py
+++ b/aleksis/apps/chronos/models.py
@@ -345,7 +345,7 @@ class LessonSubstitution(models.Model):
             raise ValidationError(_("Lessons can only be either substituted or cancelled."))
 
     @property
-    def type(self):
+    def type_(self):
         # TODO: Add cases events and supervisions
         if self.cancelled:
             return "cancellation"
diff --git a/aleksis/apps/chronos/templates/chronos/substitutions.html b/aleksis/apps/chronos/templates/chronos/substitutions.html
index f21f2c2f..204efd1a 100644
--- a/aleksis/apps/chronos/templates/chronos/substitutions.html
+++ b/aleksis/apps/chronos/templates/chronos/substitutions.html
@@ -80,7 +80,7 @@
       </td>
     {% endif %}
     {% for sub in substitutions %}
-      <tr class="{% if sub.type == "cancellation" %}green-text{% else %}black-text{% endif %}"> {# TODO: Extend support for blue and purple (supervisions and events) #}
+      <tr class="{% if sub.type_ == "cancellation" %}green-text{% else %}black-text{% endif %}"> {# TODO: Extend support for blue and purple (supervisions and events) #}
         <td>
           {% include "chronos/partials/groups.html" with groups=sub.lesson_period.lesson.groups.all %}
         </td>
diff --git a/aleksis/apps/chronos/urls.py b/aleksis/apps/chronos/urls.py
index 0bdd940f..fb3e7c2e 100644
--- a/aleksis/apps/chronos/urls.py
+++ b/aleksis/apps/chronos/urls.py
@@ -3,7 +3,7 @@ from django.urls import path
 from . import views
 
 urlpatterns = [
-    path("", views.all, name="all_timetables"),
+    path("", views.all_timetables, name="all_timetables"),
     path("timetable/my/", views.my_timetable, name="my_timetable"),
     path("timetable/my/<int:year>/<int:month>/<int:day>/", views.my_timetable, name="my_timetable_by_date"),
     path("timetable/<str:type_>/<int:pk>/", views.timetable, name="timetable"),
diff --git a/aleksis/apps/chronos/views.py b/aleksis/apps/chronos/views.py
index 08429034..444925c5 100644
--- a/aleksis/apps/chronos/views.py
+++ b/aleksis/apps/chronos/views.py
@@ -28,7 +28,7 @@ from .util.weeks import CalendarWeek, get_weeks_for_year
 
 
 @login_required
-def all(request: HttpRequest) -> HttpResponse:
+def all_timetables(request: HttpRequest) -> HttpResponse:
     context = {}
 
     teachers = Person.objects.annotate(
-- 
GitLab