Skip to content

Removing beginning / on default value on Images/Updated#155

Merged
dragos-dobre merged 3 commits intoopenimis:developfrom
mngoe:develop
Nov 15, 2022
Merged

Removing beginning / on default value on Images/Updated#155
dragos-dobre merged 3 commits intoopenimis:developfrom
mngoe:develop

Conversation

@mngoe
Copy link
Copy Markdown
Contributor

@mngoe mngoe commented Oct 5, 2022

Here is the problem we had :

  • Impossible to see beneficiary image entered on the mobile app in the web

Problem :

  • As Rest-API is Dockerized we use a volume and we make a LN , we used "insuree_photos_root_path" to define where our images are stored in the BE module. So in our configuration value of insuree_photos_root_path is "/openIMISphone"
  • Method _photo_dir do a path.join with this root path + the file dir (coming from the tables value in tblPhotos... I understood that this value comes from tblDefault on the stored procedures insert)
  • problem is path.join consider that each new absolute path found as an argument discard all previous argument : "If a path component represents an absolute path, then all previous components joined are discarded and joining continues from the absolute path component."
    https://www.geeksforgeeks.org/python-os-path-join-method/
  • So in our case , impossible to have a complete path to load our images in /openIMISphone/Images/Updated/filename. Web returns directly /images/Updates/filename and obviously file is not found.

Solution :
(Seams OK for the modular at least) , removing this beggining slash as the default value

@dragos-dobre dragos-dobre merged commit 87247dc into openimis:develop Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants