Skip to content

Commit

Permalink
Added docs to clearly state the misleading name of `SubscriptionQuery…
Browse files Browse the repository at this point in the history
…Set.active()`
  • Loading branch information
suricactus committed Feb 20, 2023
1 parent 962621d commit cb60477
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker-app/qfieldcloud/subscription/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ class Package(models.Model):

class SubscriptionQuerySet(models.QuerySet):
def active(self):
"""Returns the subscriptions which are relevant to the current moment.
WARNING the name `active` is super misleading, should be `current`. Some of the subscriptions in the queryset might not be active, but cancelled or drafted.
TODO rename to `current`
"""
now = timezone.now()
qs = self.filter(
Q(active_since__lte=now)
Expand Down

0 comments on commit cb60477

Please sign in to comment.