Permalink
Browse files

controllers.upload: disallow upload of files without a flight

  • Loading branch information...
MaxKellermann committed May 24, 2012
1 parent e0e0e2f commit 66d1c66d2eb8f0f016a18b3c563725e044655923
Showing with 5 additions and 0 deletions.
  1. +5 −0 skylines/controllers/upload.py
@@ -81,6 +81,11 @@ def do(self, file, pilot):
flights.append((name, None, _('Failed to parse file')))
continue
+ if not flight.takeoff_time or not flight.landing_time:
+ files.delete_file(filename)
+ flights.append((name, None, _('No flight found in file')))
+ continue
+
flights.append((name, flight, None))
DBSession.add(flight)

0 comments on commit 66d1c66

Please sign in to comment.