Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove rest client from celery #727

Merged
merged 6 commits into from
Jul 21, 2022
12 changes: 6 additions & 6 deletions bothub/api/v2/repository/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def projectrepository(self, request, **kwargs):
name="get_project_organization", args=[project_uuid]
)
task.wait()

repositories = repository.authorizations.filter(uuid__in=task.result)
authorizations = task.result
repositories = repository.authorizations.filter(uuid__in=authorizations)

else:
authorizations = ConnectClient().list_authorizations(
Expand All @@ -272,7 +272,7 @@ def projectrepository(self, request, **kwargs):
if organization:

organization_authorization = (
organization.organization_authorizations.filter(uuid__in=task.result)
organization.organization_authorizations.filter(uuid__in=authorizations)
)
data["in_project"] = (
data["in_project"] or organization_authorization.exists()
Expand Down Expand Up @@ -317,10 +317,10 @@ def remove_repository_project(self, request, **kwargs):
name="get_project_organization", args=[project_uuid]
)
project_organization.wait()

project_organization = project_organization.result
authorizations = list(
repository.authorizations.filter(
uuid__in=project_organization.result
uuid__in=project_organization
).values_list("uuid", flat=True)
)

Expand All @@ -343,7 +343,7 @@ def remove_repository_project(self, request, **kwargs):

authorizations += list(
organization.organization_authorizations.filter(
uuid__in=project_organization.result
uuid__in=project_organization
).values_list("uuid", flat=True)
)

Expand Down