Skip to content

Commit

Permalink
Revert "(townsquare) fix/show only mainnet bounty activities in prod (#…
Browse files Browse the repository at this point in the history
…7584)" (#7634)

This reverts commit ebbe570.
  • Loading branch information
thelostone-mc authored Oct 7, 2020
1 parent 0c9d5b9 commit 33096f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
26 changes: 3 additions & 23 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@ def has_funds(self):
return self.filter(idx_status__in=Bounty.FUNDED_STATUSES)


class BountyManager(models.Manager):
"""Enables changing the default queryset function for bounties."""

def get_queryset(self):
if settings.ENV == 'prod':
return super().get_queryset().filter(network='mainnet')
else:
return super().get_queryset()


"""Fields that bonties table should index together."""
def get_bounty_index_together():
import copy
Expand Down Expand Up @@ -403,8 +393,8 @@ class Bounty(SuperModel):
default=False, help_text=_('This bounty will be part of the hypercharged bounties')
)
hyper_next_publication = models.DateTimeField(null=True, blank=True)
# Bounty Manager from QuerySet
objects = BountyManager.from_queryset(BountyQuerySet)()
# Bounty QuerySet Manager
objects = BountyQuerySet.as_manager()

class Meta:
"""Define metadata associated with Bounty."""
Expand Down Expand Up @@ -2219,16 +2209,6 @@ def related_to(self, profile):
return posts


class ActivityManager(models.Manager):
"""Enables changing the default queryset function for Activities."""

def get_queryset(self):
if settings.ENV == 'prod':
return super().get_queryset().filter(Q(bounty=None) | Q(bounty='') | Q(bounty__network='mainnet'))
else:
return super().get_queryset()


class Activity(SuperModel):
"""Represent Start work/Stop work event.
Expand Down Expand Up @@ -2378,7 +2358,7 @@ class Activity(SuperModel):
cached_view_props = JSONField(default=dict, blank=True)

# Activity QuerySet Manager
objects = ActivityManager.from_queryset(ActivityQuerySet)()
objects = ActivityQuerySet.as_manager()

def __str__(self):
"""Define the string representation of an interested profile."""
Expand Down
2 changes: 0 additions & 2 deletions app/townsquare/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,6 @@ def town_square(request):
tab = request.GET.get('tab', request.COOKIES.get('tab', 'connect'))
try:
pinned = PinnedPost.objects.get(what=tab)
if settings.ENV == 'prod' and pinned.activity.bounty and pinned.activity.bounty != 'mainnet':
pinned = None
except PinnedPost.DoesNotExist:
pinned = None
title, desc, page_seo_text_insert, avatar_url, is_direct_link, admin_link = get_param_metadata(request, tab)
Expand Down

0 comments on commit 33096f5

Please sign in to comment.