diff --git a/core/graphene/schema.py b/core/graphene/schema.py index 2a0f7d72..4b447f7d 100644 --- a/core/graphene/schema.py +++ b/core/graphene/schema.py @@ -290,7 +290,12 @@ class Query(ObjectType): promocodes = PromoCode.objects if info.context.user.has_perm("core.view_promocode"): return promocodes.filter(user__uuid=kwargs.get("user_uuid")) or promocodes.all() - return promocodes.filter(is_active=True, user=info.context.user) + return promocodes.filter( + is_active=True, + user=info.context.user, + used_on__isnull=True, + start_time__lte=info.context.now, + ) @staticmethod def resolve_product_tags(_parent, info, **_kwargs):