Example #1
0
 def save(self, *args, **kwargs):
     """
     Whenever an IdentityMembership changes, update the provider
     specific quota too.
     """
     super(IdentityMembership, self).save(*args, **kwargs)
     try:
         from service.tasks.admin import set_provider_quota
         set_provider_quota.apply_async(args=[str(self.identity.uuid)])
     except Exception as ex:
         logger.warn("Unable to update service.quota.set_provider_quota.")
         raise
Example #2
0
 def approve_quota(self, request_id):
     """
     Approves the quota request and updates the request
     """
     super(IdentityMembership, self).save()
     try:
         from service.tasks.admin import set_provider_quota,\
             set_quota_request_failed
         set_provider_quota.apply_async(
             args=[self.identity.uuid],
             link_error=set_quota_request_failed.s(request_id))
     except Exception as ex:
         logger.warn("Unable to update service.quota.set_provider_quota.")
         raise