def delete(self, id): membership_plan = get_membership_plan(id) try: membership_plan.delete() return Response.createDeleteSuccessResponse(self, ResponseMessages.delete_success, HTTPStatus.NO_CONTENT) except: return Response.createFailResponse(self, ResponseMessages.delete_fail, HTTPStatus.NOT_ACCEPTABLE)
def delete(self, id): tenant_subscription = get_tenant_subscription(self, id) if not tenant_subscription: return Response.createFailResponse(self, ResponseMessages.not_exist, HTTPStatus.NO_CONTENT) tenant_subscription.delete() return Response.createDeleteSuccessResponse( self, ResponseMessages.delete_success, HTTPStatus.NO_CONTENT)
def delete(self, id): """ Delete a tenant with a given ID """ tenant = get_tenant(id) try: tenant.delete() return Response.createDeleteSuccessResponse( self, ResponseMessages.delete_success, HTTPStatus.NO_CONTENT) except: return Response.createFailResponse(self, ResponseMessages.delete_fail, HTTPStatus.NOT_ACCEPTABLE)
def delete(self, id): """ Delete a users with a given id """ user = get_user(id) try: user.delete() return Response.createDeleteSuccessResponse( self, ResponseMessages.delete_success, HTTPStatus.NO_CONTENT) except: return Response.createFailResponse(self, ResponseMessages.delete_fail, HTTPStatus.NOT_ACCEPTABLE)