Combine multi traffic into one name until stats system is smarter.

This commit is contained in:
Max Goodman
2013-03-09 14:50:50 -08:00
parent 6bc10248f5
commit c28e756c42
2 changed files with 11 additions and 1 deletions

View File

@@ -128,7 +128,7 @@ def _decrypt(encrypted, secret):
def get_site():
"""Return the name of the current "site" (subreddit)."""
return c.site.name if c.site else ""
return c.site.analytics_name if c.site else ""
def get_srpath():

View File

@@ -85,6 +85,10 @@ class BaseSite(object):
def path(self):
return "/r/%s/" % self.name
@property
def analytics_name(self):
return self.name
def is_moderator_with_perms(self, user, *perms):
rel = self.is_moderator(user)
if rel:
@@ -1364,6 +1368,12 @@ class LabeledMulti(MultiReddit, tdb_cassandra.Thing):
def name(self):
return self.path.split('/')[-1]
@property
def analytics_name(self):
# classify as "multi" (as for unnamed multis) until our traffic system
# is smarter
return 'multi'
def can_view(self, user):
return user == self.owner or self.visibility == 'public'