File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ def bulk_create_from_site_model(
158158
159159 point = None
160160 geom = None
161+ smqtk_uuid = None
162+ if site_feature .properties .cache :
163+ smqtk_uuid = site_feature .properties .cache .smqtk_uuid
161164 if isinstance (site_feature .parsed_geometry , Point ):
162165 point = site_feature .parsed_geometry
163166 else :
@@ -177,7 +180,7 @@ def bulk_create_from_site_model(
177180 cache_originator_file = cache_originator_file ,
178181 cache_timestamp = cache_timestamp ,
179182 cache_commit_hash = cache_commit_hash ,
180- smqtk_uuid = site_feature . properties . cache . smqtk_uuid ,
183+ smqtk_uuid = smqtk_uuid ,
181184 modified_timestamp = datetime .now (),
182185 )
183186 SiteObservation .bulk_create_from_site_evaluation (site_eval , site_model )
Original file line number Diff line number Diff line change @@ -129,12 +129,12 @@ def get_session_info(request: HttpRequest, sid: str):
129129 return 200 , resp .json ()
130130
131131
132- def pick_site_image (images : list [SiteImage ], observations : list [SiteObservation ]):
132+ def pick_site_image (images : list [SiteImage ], observations : list [SiteObservation ]) -> SiteImage | None :
133133 # ignore observations with no timestamps
134134 observations = [o for o in observations if o .timestamp is not None ]
135135
136136 if not len (images ):
137- raise Exception ( 'no observations or images' )
137+ return None
138138 if not len (observations ):
139139 return images [- 1 ]
140140
You can’t perform that action at this time.
0 commit comments