diff options
author | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-10-18 14:56:16 +0300 |
---|---|---|
committer | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-10-18 13:22:34 +0000 |
commit | 6bc9c1e7f0391304c954c0635e7485b433ee2cf1 (patch) | |
tree | 37d7c350acd3151eaeb92745450031c43fcd6dba /opnfv_testapi | |
parent | c05e2986e658d9892c9d65203a1e2a785c68bf27 (diff) |
Make uploaded company logos persistentovp-2.0.0
JIRA: DOVETAIL-741
This patch make uploaded company logos from administrator persistent
by saving them to a permanent docker volume, mounted to a specific
path inside api container.
Change-Id: I0b0ef66cc2b3761863a2f58da0196d302d4b5ade
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
Diffstat (limited to 'opnfv_testapi')
-rw-r--r-- | opnfv_testapi/resources/application_handlers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opnfv_testapi/resources/application_handlers.py b/opnfv_testapi/resources/application_handlers.py index 258c1aa..7cecd3e 100644 --- a/opnfv_testapi/resources/application_handlers.py +++ b/opnfv_testapi/resources/application_handlers.py @@ -42,7 +42,7 @@ class ApplicationsLogoHandler(GenericApplicationHandler): fileinfo = self.request.files['file'][0] fname = fileinfo['filename'] - location = '3rd_party/static/testapi-ui/assets/img/' + location = 'media/companies/' fh = open(location + fname, 'w') fh.write(fileinfo['body']) msg = 'Successfully uploaded logo: ' + fname @@ -52,7 +52,7 @@ class ApplicationsLogoHandler(GenericApplicationHandler): class ApplicationsGetLogoHandler(GenericApplicationHandler): def get(self, filename): - location = '3rd_party/static/testapi-ui/assets/img/' + filename + location = 'media/companies/' + filename self.set_header('Content-Type', 'application/force-download') self.set_header('Content-Disposition', 'attachment; filename=%s' % filename) |