Project

General

Profile

Bug #1909

User Story #1897: API endpoints to add new cases

Updating Questionnaire: Only adding image is not working

Added by Kurt Gerber over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
15 Sep 2020
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

When I add an image to a techology (formerly uploaded) by adding the following the list of picture under qg_photos:

"qg_photos": [
  {
   ... (already existing images)
 }, 
{
                "image":"6777f9bd-e536-488a-8681-921b7e08d603",
                "image_date": "07/06/2009",
                "image_caption": {
                    "en": "The photo shows some funny test image",
                    "th": "The photo shows some funny test image" 
                },
                "image_location": {
                    "en": "Lake Nakuru National Park, Kenya",
                    "th": "Lake Nakuru National Park, Kenya" 
                },
                "image_photographer": {
                    "en": "xy",
                    "th": "xy" 
                }
            }
 ]

When sending this update with POST , the response says:

"No changes detected" and the image is not appended.

When I change some description text somewhere else, it resonds 'successfull' and the image is added.

When I try to remove an image by removing an image from qg_photos, it answers again:

" No changes detected"

I'm wondering, what it is testing to detect changes. I think, it should rather use something like a 'hash comparison' so that each change, even if it is only a space in text string, should be recoginzed as change.

#1

Updated by Kurt Gerber over 4 years ago

  • Status changed from New to Accepted
#2

Updated by Brahadeesh Dheenadayalan_Sivakami over 4 years ago

  • Status changed from Accepted to Resolved
  • Assignee changed from Brahadeesh Dheenadayalan_Sivakami to Kurt Gerber

This should be all fixed now.
The comparison was only checking for updates to those nested items that already existed.
All it needed was a check that the length was matching or not.
Comparison between python dictionaries uses a hash method natively.

#3

Updated by Brahadeesh Dheenadayalan_Sivakami over 4 years ago

  • Status changed from Resolved to Feedback
#4

Updated by Kurt Gerber over 4 years ago

  • Status changed from Feedback to Closed

Works now.

Also available in: Atom PDF