diff --git a/logbook/management/commands/import_flightlog.py b/logbook/management/commands/import_flightlog.py
index d53ccf8..d9d1a09 100644
--- a/logbook/management/commands/import_flightlog.py
+++ b/logbook/management/commands/import_flightlog.py
@@ -110,7 +110,7 @@ def handle(self, *args, **options):
"departure_time": departure_time,
"arrival_time": arrival_time,
"landings": int(row[Fields.LANDINGS]),
- "time_function": time_function.name,
+ "time_function": time_function,
"pilot": pilot,
"copilot": copilot,
"launch_type": launch_type,
diff --git a/logbook/templates/logbook/logentry_list.html b/logbook/templates/logbook/logentry_list.html
index b3e2f8a..f889d87 100644
--- a/logbook/templates/logbook/logentry_list.html
+++ b/logbook/templates/logbook/logentry_list.html
@@ -17,12 +17,12 @@
Log entries
From To |
Departure Arrival |
{% for aircraft_type in AircraftType reversed %}
- {{ aircraft_type.name }} |
+ {{ aircraft_type }} |
{% endfor %}
Landings |
Name |
{% for function_type in FunctionType %}
- {{ function_type.name }} |
+ {{ function_type }} |
{% endfor %}
Remarks |
@@ -36,7 +36,7 @@ Log entries
{{ obj.departure_time | time:"H:i" }} {{ obj.arrival_time | time:"H:i" }} |
{% for aircraft_type in AircraftType reversed %}
- {% if obj.aircraft.type == aircraft_type.name %}
+ {% if obj.aircraft.type == aircraft_type %}
{{ obj.arrival_time | subtract:obj.departure_time | duration:"%h:%M" }}
{% elif obj is not None %}
-
@@ -47,7 +47,7 @@ Log entries
| {% if not obj.pilot.self %}{{ obj.pilot.first_name.0 }}. {{ obj.pilot.last_name }}{% else %}Self{% endif %} |
{% for function_type in FunctionType %}
- {% if obj.time_function == function_type.name %}
+ {% if obj.time_function == function_type %}
{{ obj.arrival_time | subtract:obj.departure_time | duration:"%h:%M" }}
{% elif obj is not None %}
-
diff --git a/logbook/views/entries.py b/logbook/views/entries.py
index a7b754d..15f2b18 100644
--- a/logbook/views/entries.py
+++ b/logbook/views/entries.py
@@ -69,7 +69,7 @@ def parse_pilot(name: str) -> Pilot:
departure_time=departure_time,
arrival_time=arrival_time,
landings=int(flight_data["landingcount"]),
- time_function=time_function.name,
+ time_function=time_function,
pilot=pilot,
copilot=copilot,
remarks=html.unescape(flight_data["comment"]),
|