summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile.api3
-rw-r--r--docker/docker-compose.yml2
-rw-r--r--opnfv_testapi/resources/application_handlers.py4
3 files changed, 6 insertions, 3 deletions
diff --git a/docker/Dockerfile.api b/docker/Dockerfile.api
index 4840739..19bde76 100644
--- a/docker/Dockerfile.api
+++ b/docker/Dockerfile.api
@@ -53,7 +53,8 @@ RUN git config --global http.sslVerify false && \
git clone https://gerrit.opnfv.org/gerrit/dovetail-webportal $HOME/testapi && \
cd $HOME/testapi && \
git checkout -f $BRANCH && \
- mkdir -p $HOME/testapi/logs/api
+ mkdir -p $HOME/testapi/logs/api && \
+ mkdir -p $HOME/testapi/media/companies
WORKDIR $HOME/testapi
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index c4bb0c4..12278c2 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -41,6 +41,7 @@ services:
- config.env
volumes:
- cvp-testapi-logs:/home/testapi/logs
+ - cvp-company-logos:/home/testapi/media/companies
ports:
- "8011:8011"
nginx:
@@ -56,4 +57,5 @@ services:
volumes:
cvp-db:
+ cvp-company-logos:
cvp-testapi-logs:
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)