We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fba901e commit 9c5a593Copy full SHA for 9c5a593
coral_credits/api/db_utils.py
@@ -71,12 +71,13 @@ def get_all_active_reservations(resource_provider_account):
71
72
def get_credit_allocation(id):
73
now = timezone.now()
74
- try:
75
- credit_allocation = models.CreditAllocation.objects.filter(
76
- id=id, start__lte=now, end__gte=now
+
+ credit_allocation = models.CreditAllocation.objects.filter(
+ id=id
77
).first()
78
- except models.CreditAllocation.DoesNotExist:
+ if credit_allocation == None:
79
raise db_exceptions.NoCreditAllocation("Invalid allocation_id")
80
81
return credit_allocation
82
83
0 commit comments