Commit 1373296b authored by Ian Evangelista's avatar Ian Evangelista
Browse files

more descriptive variable names

parent 5cda79e5
Pipeline #170934 passed with stage
in 26 seconds
......@@ -100,22 +100,20 @@ class OfferList(
Q(owner=self.request.user) | Q(recipient=self.request.user)
).distinct()
qp = self.request.query_params
u = self.request.user
user = self.request.user
# filtering by status (if provided)
s = qp.get("status", None)
if s is not None and self.request is not None:
qs = qs.filter(status=s)
status = qp.get("status", None)
if status is not None and self.request is not None:
qs = qs.filter(status=status)
if qp.get("status", None) is None:
qs = Offer.objects.filter(Q(owner=u)).distinct()
# filtering by category (sent or received)
c = qp.get("category", None)
if c is not None and qp is not None:
if c == "sent":
qs = qs.filter(owner=u)
elif c == "received":
qs = qs.filter(recipient=u)
qs = Offer.objects.filter(Q(owner=user)).distinct()
category = qp.get("category", None)
if category is not None and qp is not None:
if category == "sent":
qs = qs.filter(owner=user)
elif category == "received":
qs = qs.filter(recipient=user)
return qs
else:
return result
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment