Skip to content

Commit bb17443

Browse files
authored
Merge branch 'main' into feature/fix-in-release-flows-dashboard
2 parents fd0100e + afd20de commit bb17443

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

insights/authentication/authentication.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
from django.contrib.auth import get_user_model
77
from django.contrib.auth.models import Permission
88
from django.contrib.contenttypes.models import ContentType
9+
from django.utils import translation
910
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
11+
from mozilla_django_oidc.contrib.drf import OIDCAuthentication
1012
from rest_framework.authentication import BaseAuthentication
1113
from rest_framework.exceptions import AuthenticationFailed
1214

13-
from mozilla_django_oidc.contrib.drf import OIDCAuthentication
14-
from django.utils import translation
15-
1615
from insights.users.usecases import CreateUserUseCase
1716

18-
1917
LOGGER = logging.getLogger("weni_django_oidc")
2018

2119
User = get_user_model()

insights/projects/viewsets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def verify_project_indexer(self, request, source_slug=None, *args, **kwargs):
6060

6161
project = Project.objects.get(pk=self.kwargs["pk"])
6262

63-
if str(project.pk) in settings.PROJECT_ALLOW_LIST:
63+
if str(project.pk) in settings.PROJECT_ALLOW_LIST or project.is_allowed:
6464
return Response(True)
6565

6666
return Response(False)
@@ -81,6 +81,8 @@ def release_flows_dashboard(self, request, *args, **kwargs):
8181

8282
rollback_needed = False
8383
webhook_error = False
84+
project.is_allowed = True
85+
project.save()
8486

8587
try:
8688
project.is_allowed = True
@@ -117,6 +119,8 @@ def release_flows_dashboard(self, request, *args, **kwargs):
117119
)
118120

119121
if webhook_error:
122+
project.is_allowed = original_is_allowed
123+
project.save()
120124
return Response(
121125
{"detail": "Failed to process webhook request"},
122126
status=status.HTTP_500_INTERNAL_SERVER_ERROR,

0 commit comments

Comments
 (0)