Commit f73f30f7 authored by fred's avatar fred

handle empty file set

parent a5f514f8
...@@ -74,7 +74,10 @@ class Track(models.Model): ...@@ -74,7 +74,10 @@ class Track(models.Model):
return self.nonstopfile_set.all().order_by('creation_timestamp').last().get_local_filepath() return self.nonstopfile_set.all().order_by('creation_timestamp').last().get_local_filepath()
def file_exists(self): def file_exists(self):
return os.path.exists(self.nonstopfile_set.order_by('creation_timestamp').last().get_local_filepath()) try:
return os.path.exists(self.nonstopfile_set.order_by('creation_timestamp').last().get_local_filepath())
except AttributeError:
return False
def sync_nonstop_zones(self): def sync_nonstop_zones(self):
if not self.file_exists(): if not self.file_exists():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment