Skip to content

Commit

Permalink
Change storage file path variable
Browse files Browse the repository at this point in the history
  • Loading branch information
LePetitTim committed May 17, 2022
1 parent e03dc2c commit 88271ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terra_geocrud/properties/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def store_feature_files(feature, old_properties=None):
# check if file has been saved in storage
if file_content != fake_content:
delete_old_picture_property(file_prop, old_properties)
stored_name = storage.save(storage_file_path, ContentFile(base64.b64decode(file_content)))
storage_file_path = storage.save(storage_file_path, ContentFile(base64.b64decode(file_content)))
# patch file_infos with new path
detail_infos = file_info.split(';name=')
new_info = f"{detail_infos[0]};name={stored_name}"
new_info = f"{detail_infos[0]};name={storage_file_path}"
feature.properties[file_prop] = f'{new_info};base64,{fake_content}'
feature.save()
else:
Expand Down

0 comments on commit 88271ce

Please sign in to comment.