diff --git a/pandora/app/views.py b/pandora/app/views.py index f6343d745..9fbff09c9 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -159,6 +159,10 @@ def init(request, data): if 'HTTP_ACCEPT_LANGUAGE' in request.META: response['data']['locale'] = request.META['HTTP_ACCEPT_LANGUAGE'].split(';')[0].split('-')[0] + + if request.META.get('HTTP_X_PREFIX') == 'NO': + config['site']['videoprefix'] = '' + config['site']['mediaprefix'] = '' response['data']['site'] = config response['data']['user'] = init_user(request.user, request) request.session['last_init'] = str(datetime.now()) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 7b3c97c0f..5897503dc 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -422,9 +422,9 @@ class File(models.Model): data[key] = self.info.get(key) data['users'] = list(set([i['user'] for i in data['instances']])) data['item'] = self.item.public_id - if 'url' in keys and 'url' in self.info: - data['url'] = self.info['url'] if keys: + if 'url' in keys and 'url' in self.info: + data['url'] = self.info['url'] for k in list(data): if k not in keys: del data[k]