File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1259,11 +1259,12 @@ def create(self, validated_data):
12591259 report = validated_data .pop ('report' )
12601260
12611261 # TODO: Create a Review model for this.
1262- ExpertReportAnnotation .objects .update_or_create (
1262+ obj , _ = ExpertReportAnnotation .objects .update_or_create (
12631263 user = self .context .get ('request' ).user ,
12641264 report = report ,
12651265 defaults = validated_data
12661266 )
1267+ obj .create_replicas ()
12671268
12681269 identification_task = report .identification_task
12691270 identification_task .refresh_from_db ()
@@ -1306,7 +1307,11 @@ def validate(self, data):
13061307 data ['revise' ] = True
13071308 data ['status' ] = ExpertReportAnnotation .STATUS_HIDDEN if not data .pop ('is_safe' ) else ExpertReportAnnotation .STATUS_PUBLIC
13081309 data ['simplified_annotation' ] = False
1309- data ['edited_user_notes' ] = data .pop ('public_note' , None )
1310+ data ['edited_user_notes' ] = data .pop ('public_note' , None ) or ""
1311+ # Case Not an insect will be empty taxon. In case of update we need to for it to None
1312+ data ['taxon' ] = data .pop ('taxon' , None )
1313+ data ['validation_value' ] = data .pop ('validation_value' , None )
1314+ data ['confidence' ] = data .pop ('confidence' , 0 )
13101315
13111316 if public_photo_uuid := data .pop ('photo__uuid' , None ):
13121317 try :
You can’t perform that action at this time.
0 commit comments