Skip to content

Commit

Permalink
Put back license endpoint billing manager
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Oct 11, 2024
1 parent 4278277 commit bbf0813
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ee/api/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,9 @@ def license(self, request: Request, *args: Any, **kwargs: Any) -> HttpResponse:
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

license = License(key=serializer.validated_data["license"])
billing_manager = self.get_billing_manager()
res = requests.get(
f"{BILLING_SERVICE_URL}/api/billing",
headers=billing_manager.get_auth_headers(organization),
headers=BillingManager(license).get_auth_headers(organization),
)

if res.status_code != 200:
Expand All @@ -332,7 +331,7 @@ def license(self, request: Request, *args: Any, **kwargs: Any) -> HttpResponse:
}
)
data = res.json()
billing_manager.update_license_details(data)
BillingManager(license).update_license_details(data)
return Response({"success": True})

def _get_org(self) -> Optional[Organization]:
Expand Down

0 comments on commit bbf0813

Please sign in to comment.