Skip to content

Commit 54c0317

Browse files
style: Format managers.py and views.py to comply with ruff
1 parent 6a39a5c commit 54c0317

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

promo_code/business/managers.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def for_company(self, user):
5454
return self.with_related().filter(company=user)
5555

5656
def get_feed_for_user(
57-
self, user, active_filter=None, user_country=None, user_age=None,
57+
self,
58+
user,
59+
active_filter=None,
60+
user_country=None,
61+
user_age=None,
5862
):
5963
"""
6064
Retrieve a queryset of Promo objects for a given user, filtered
@@ -94,7 +98,8 @@ def _q_is_active(self, today):
9498
used_count__lt=django.db.models.F('max_count'),
9599
)
96100
unique = django.db.models.Q(
97-
mode=business.constants.PROMO_MODE_UNIQUE, _has_unique_codes=True,
101+
mode=business.constants.PROMO_MODE_UNIQUE,
102+
_has_unique_codes=True,
98103
)
99104

100105
return qt & tu & (common | unique)
@@ -105,7 +110,8 @@ def _q_has_unique_codes(self):
105110
for each promo.
106111
"""
107112
subq = business.models.PromoCode.objects.filter(
108-
promo=django.db.models.OuterRef('pk'), is_used=False,
113+
promo=django.db.models.OuterRef('pk'),
114+
is_used=False,
109115
)
110116
return django.db.models.Exists(subq)
111117

promo_code/user/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def dispatch(self, request, *args, **kwargs):
200200

201201

202202
class PromoCommentListCreateView(
203-
PromoObjectMixin, rest_framework.generics.ListCreateAPIView,
203+
PromoObjectMixin,
204+
rest_framework.generics.ListCreateAPIView,
204205
):
205206
permission_classes = [rest_framework.permissions.IsAuthenticated]
206207

0 commit comments

Comments
 (0)