Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-at-mit committed Feb 25, 2025
1 parent bca6ee5 commit 783d7e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
9 changes: 4 additions & 5 deletions courses/views/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ def get_queryset(self):

def get_serializer_context(self):
added_context = {}
if self.request and self.request.query_params:
if self.request.query_params.get("readable_id", None):
added_context["all_runs"] = True
if self.request.query_params.get("include_approved_financial_aid", None):
added_context["include_approved_financial_aid"] = True
if self.request.query_params.get("readable_id", None):
added_context["all_runs"] = True
if self.request.query_params.get("include_approved_financial_aid", None):
added_context["include_approved_financial_aid"] = True

return {**super().get_serializer_context(), **added_context}

Expand Down
13 changes: 1 addition & 12 deletions ecommerce/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,7 @@ class Meta:


class DiscountSerializer(serializers.ModelSerializer):

id = serializers.IntegerField()
amount = serializers.DecimalField(max_digits=9, decimal_places=2)
automatic = serializers.BooleanField()
discount_type = serializers.ChoiceField(choices=DISCOUNT_TYPES)
redemption_type = serializers.ChoiceField(choices=PAYMENT_TYPES)
max_redemptions = serializers.IntegerField()
discount_code = serializers.CharField()
payment_type = serializers.ChoiceField(choices=PAYMENT_TYPES)
is_redeemed = serializers.BooleanField()
activation_date = serializers.DateTimeField()
expiration_date = serializers.DateTimeField()

class Meta:
model = models.Discount
fields = [
Expand Down

0 comments on commit 783d7e9

Please sign in to comment.