default for default_update
This commit is contained in:
parent
aa31a4e192
commit
892de944f9
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ from shapely import prepared
|
||||||
from shapely.geometry import box
|
from shapely.geometry import box
|
||||||
from shapely.ops import unary_union
|
from shapely.ops import unary_union
|
||||||
|
|
||||||
|
from c3nav.mapdata.models import MapUpdate
|
||||||
from c3nav.mapdata.utils.models import get_submodels
|
from c3nav.mapdata.utils.models import get_submodels
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ class MapHistory:
|
||||||
return cls(resolution, x, y, list(updates), data)
|
return cls(resolution, x, y, list(updates), data)
|
||||||
except (FileNotFoundError, struct.error):
|
except (FileNotFoundError, struct.error):
|
||||||
if default_update is None:
|
if default_update is None:
|
||||||
raise
|
default_update = MapUpdate.last_update()
|
||||||
new_empty = cls(updates=[default_update])
|
new_empty = cls(updates=[default_update])
|
||||||
new_empty.save(filename)
|
new_empty.save(filename)
|
||||||
return new_empty
|
return new_empty
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue