Skip to content

Commit

Permalink
fix(enum): remove some dangling .name calls after enum migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Nov 3, 2023
1 parent cedc3a7 commit c445099
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion logbook/management/commands/import_flightlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions logbook/templates/logbook/logentry_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ <h1>Log entries</h1>
<th>From<br>To</th>
<th>Departure<br>Arrival</th>
{% for aircraft_type in AircraftType reversed %}
<th class="text-center">{{ aircraft_type.name }}</th>
<th class="text-center">{{ aircraft_type }}</th>
{% endfor %}
<th class="text-center">Landings</th>
<th>Name</th>
{% for function_type in FunctionType %}
<th class="text-center">{{ function_type.name }}</th>
<th class="text-center">{{ function_type }}</th>
{% endfor %}
<th>Remarks</th>
</tr>
Expand All @@ -36,7 +36,7 @@ <h1>Log entries</h1>
<td>{{ obj.departure_time | time:"H:i" }}<br>{{ obj.arrival_time | time:"H:i" }}</td>
{% for aircraft_type in AircraftType reversed %}
<td class="text-center">
{% 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 %}
-
Expand All @@ -47,7 +47,7 @@ <h1>Log entries</h1>
<td>{% if not obj.pilot.self %}{{ obj.pilot.first_name.0 }}. {{ obj.pilot.last_name }}{% else %}Self{% endif %}</td>
{% for function_type in FunctionType %}
<td class="text-center">
{% 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 %}
-
Expand Down
2 changes: 1 addition & 1 deletion logbook/views/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand Down

0 comments on commit c445099

Please sign in to comment.