Skip to content

Commit

Permalink
add nocache
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Nov 16, 2015
1 parent cb44a05 commit 77cbb3f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions intranet/apps/eighth/forms/admin/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def __init__(self, label="Activity", block=None, sponsor=None, *args, **kwargs):
activity_ids = (EighthScheduledActivity.objects
.filter(block=block)
.filter(sponsoring_filter)
.values_list("activity__id", flat=True))
.values_list("activity__id", flat=True)
.nocache())
else:
activity_ids = (EighthScheduledActivity.objects
.exclude(activity__deleted=True)
.exclude(cancelled=True)
.filter(block=block)
.values_list("activity__id", flat=True))
.values_list("activity__id", flat=True)
.nocache())
queryset = (EighthActivity.objects.filter(id__in=activity_ids)
.order_by("name"))
else:
Expand Down Expand Up @@ -84,12 +86,14 @@ def __init__(self, label="Activities", block=None, *args, **kwargs):
.exclude(activity__deleted=True)
.exclude(cancelled=True)
.filter(block=block)
.values_list("activity__id", flat=True))
.values_list("activity__id", flat=True)
.nocache())
queryset = (EighthActivity.objects.filter(id__in=activity_ids)
.order_by("name"))
else:
queryset = (EighthActivity.undeleted_objects.all()
.order_by("name"))
.order_by("name")
.nocache())

logger.debug(queryset)
self.fields["activities"].queryset = queryset
Expand Down

0 comments on commit 77cbb3f

Please sign in to comment.