Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move from constance to settings

  • Loading branch information...
commit 814128a0740196dc001ee0865e64c34f0c6664b5 1 parent e639005
@groovecoder groovecoder authored
View
4 apps/wiki/models.py
@@ -1846,8 +1846,8 @@ def get_file_url(self):
uri = reverse('wiki.raw_file', kwargs={'attachment_id': self.id,
'filename': self.current_revision.filename()})
url = '%s%s%s' % (settings.PROTOCOL,
- constance.config.ATTACHMENT_HOST,
- uri)
+ settings.ATTACHMENT_HOST,
+ uri)
return url
def attach(self, document, user, name):
View
4 apps/wiki/tests/test_views.py
@@ -3224,7 +3224,7 @@ def test_edit_attachment(self):
ok_(rev.is_approved)
url = attachment.get_file_url()
- resp = self.client.get(url, HTTP_HOST=constance.config.ATTACHMENT_HOST)
+ resp = self.client.get(url, HTTP_HOST=settings.ATTACHMENT_HOST)
eq_('text/plain', rev.mime_type)
ok_('I am a new version of the test file for editing.' in resp.content)
@@ -3238,7 +3238,7 @@ def test_attachment_raw_requires_attachment_host(self):
eq_(attachment.get_file_url(), resp['Location'])
url = attachment.get_file_url()
- resp = self.client.get(url, HTTP_HOST=constance.config.ATTACHMENT_HOST)
+ resp = self.client.get(url, HTTP_HOST=settings.ATTACHMENT_HOST)
eq_(200, resp.status_code)
def test_attachment_detail(self):
View
2  apps/wiki/views.py
@@ -2088,7 +2088,7 @@ def raw_file(request, attachment_id, filename):
attachment = get_object_or_404(Attachment, pk=attachment_id)
if attachment.current_revision is None:
raise Http404
- if request.get_host() == constance.config.ATTACHMENT_HOST:
+ if request.get_host() == settings.ATTACHMENT_HOST:
rev = attachment.current_revision
resp = HttpResponse(rev.file.read(), mimetype=rev.mime_type)
resp["Last-Modified"] = rev.created
View
3  docs/installation-vagrant.rst
@@ -72,7 +72,8 @@ Getting up and running
- Add developer-dev.mozilla.org to /etc/hosts::
- echo '192.168.10.55 developer-local.allizom.org' >> /etc/hosts
+ echo '192.168.10.55 developer-local.allizom.org
+ mdn-local.mozillademos.org' >> /etc/hosts
- Everything should be working now, from the host side::
View
2  puppet/files/vagrant/settings_local.py
@@ -129,3 +129,5 @@
KUMASCRIPT_URL_TEMPLATE = 'http://localhost:9080/docs/{path}'
STATSD_CLIENT = 'django_statsd.clients.toolbar'
+
+ATTACHMENT_HOST = 'mdn-local.mozillademos.org'
View
7 settings.py
@@ -762,6 +762,8 @@ def JINJA_CONFIG():
# Default storage engine - ours does not preserve filenames
#DEFAULT_FILE_STORAGE = 'upload.storage.RenameFileStorage'
+ATTACHMENT_HOST = 'mdn.mozillademos.org'
+
# Auth and permissions related constants
LOGIN_URL = '/users/login'
LOGOUT_URL = '/users/logout'
@@ -1042,11 +1044,6 @@ def read_only_mode(env):
'(space-separated)'
),
- ATTACHMENT_HOST = (
- 'mdn.mozillademos.org',
- 'Host from which attachments should be served',
- ),
-
GOOGLE_ANALYTICS_ACCOUNT = (
'0',
'Google Analytics Tracking Account Number (0 to disable)',
Please sign in to comment.
Something went wrong with that request. Please try again.