Skip to content

Commit

Permalink
fix(entries): repair vereinsflieger import after switching form handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Oct 30, 2023
1 parent 6349400 commit 01e3f06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions logbook/views/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ class EntryIndexView(AuthenticatedListView, FormView):
form_class = VereinsfliegerForm
success_url = reverse_lazy("logbook:entries")

def post(self, request, *args, **kwargs):
return super().get(self, request, *args, **kwargs)

def get_context_data(self, *args, **kwargs):
return super().get_context_data(*args, **kwargs) | {
"aircraft_types": list(AircraftType),
"function_types": list(FunctionType),
"form": self.get_form(),
}

def paginate_queryset(self, queryset, page_size):
Expand All @@ -107,3 +105,6 @@ def form_valid(self, form):
flight_id, log_entry = form.import_flight()
messages.success(self.request, f"Flight #{flight_id} imported successfully as #{log_entry.id}!")
return super().form_valid(form)

def form_invalid(self, form):
return super().get(self.request, *self.args, **self.kwargs)

0 comments on commit 01e3f06

Please sign in to comment.