Skip to content

Commit

Permalink
[#630] Modify piwik_tags to look for an ID in the partner site object
Browse files Browse the repository at this point in the history
for the current partner site.
  • Loading branch information
zzgvh committed Aug 28, 2014
1 parent 621f389 commit 2a9ccd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions akvo/rsr/templatetags/piwik_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

@register.inclusion_tag('piwik/tracking_code.html')
def tracking_code():
try:
id = settings.PIWIK_SITE_ID
except AttributeError:
raise ImproperlyConfigured('PIWIK_SITE_ID does not exist.')
if settings.PARTNER_SITE and settings.PARTNER_SITE.piwik_id:
id = settings.PARTNER_SITE.piwik_id
else:
try:
id = settings.PIWIK_SITE_ID
except AttributeError:
raise ImproperlyConfigured('PIWIK_SITE_ID does not exist.')
try:
url = settings.PIWIK_URL
except AttributeError:
Expand Down
2 changes: 1 addition & 1 deletion akvo/settings/25-partner-sites.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ RSR_SITE_REGEXPS = [
'^localhost$',
'^127\.0\.0\.1$',
'^(www\.)?akvo.dev$',
'^77\.53\.15\.119$',
]

PARTNER_SITE_REGEXPS = [
Expand All @@ -17,4 +16,5 @@ PARTNER_SITE_REGEXPS = [
'\.akvotest\.org$',
'\.akvotest2\.org$',
'\.akvotest3\.org$',
'\.localakvoapp\.org$',
]

0 comments on commit 2a9ccd5

Please sign in to comment.