5151def gitlab_auth_required (func ): # type: ignore[no-untyped-def]
5252 @wraps (func )
5353 def wrapper (request , project_pk ): # type: ignore[no-untyped-def]
54- if not GitLabConfiguration .has_gitlab_configuration (
55- project_id = project_pk
56- ):
54+ if not GitLabConfiguration .has_gitlab_configuration (project_id = project_pk ):
5755 return Response (
5856 data = {
5957 "detail" : "This Project doesn't have a valid GitLab Configuration"
@@ -110,7 +108,9 @@ def get_serializer_class(self): # type: ignore[no-untyped-def]
110108 def perform_create (self , serializer ): # type: ignore[no-untyped-def]
111109 project_id = self .kwargs ["project_pk" ]
112110 serializer .save (project_id = project_id )
113- if serializer .validated_data .get ("tagging_enabled" , False ) and serializer .validated_data .get ("gitlab_project_id" ):
111+ if serializer .validated_data .get (
112+ "tagging_enabled" , False
113+ ) and serializer .validated_data .get ("gitlab_project_id" ):
114114 create_flagsmith_flag_label (
115115 instance_url = serializer .validated_data ["gitlab_instance_url" ],
116116 access_token = serializer .validated_data ["access_token" ],
@@ -121,9 +121,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
121121 if getattr (self , "swagger_fake_view" , False ):
122122 return GitLabConfiguration .objects .none ()
123123
124- return GitLabConfiguration .objects .filter (
125- project_id = self .kwargs ["project_pk" ]
126- )
124+ return GitLabConfiguration .objects .filter (project_id = self .kwargs ["project_pk" ])
127125
128126 def create (self , request , * args , ** kwargs ): # type: ignore[no-untyped-def]
129127 try :
@@ -165,7 +163,9 @@ def fetch_merge_requests(request, project_pk) -> Response: # type: ignore[no-un
165163 access_token = gitlab_config .access_token ,
166164 params = query_serializer .validated_data ,
167165 )
168- return Response (data = data , content_type = "application/json" , status = status .HTTP_200_OK )
166+ return Response (
167+ data = data , content_type = "application/json" , status = status .HTTP_200_OK
168+ )
169169
170170
171171@api_view (["GET" ])
@@ -186,7 +186,9 @@ def fetch_issues(request, project_pk) -> Response: # type: ignore[no-untyped-de
186186 access_token = gitlab_config .access_token ,
187187 params = query_serializer .validated_data ,
188188 )
189- return Response (data = data , content_type = "application/json" , status = status .HTTP_200_OK )
189+ return Response (
190+ data = data , content_type = "application/json" , status = status .HTTP_200_OK
191+ )
190192
191193
192194@api_view (["GET" ])
@@ -205,7 +207,9 @@ def fetch_projects(request, project_pk: int) -> Response | None: # type: ignore
205207 access_token = gitlab_config .access_token ,
206208 params = query_serializer .validated_data ,
207209 )
208- return Response (data = data , content_type = "application/json" , status = status .HTTP_200_OK )
210+ return Response (
211+ data = data , content_type = "application/json" , status = status .HTTP_200_OK
212+ )
209213
210214
211215@api_view (["GET" ])
@@ -225,7 +229,9 @@ def fetch_project_members(request, project_pk) -> Response: # type: ignore[no-u
225229 access_token = gitlab_config .access_token ,
226230 params = query_serializer .validated_data ,
227231 )
228- return Response (data = response , content_type = "application/json" , status = status .HTTP_200_OK )
232+ return Response (
233+ data = response , content_type = "application/json" , status = status .HTTP_200_OK
234+ )
229235
230236
231237@api_view (["POST" ])
@@ -279,7 +285,9 @@ def create_cleanup_issue(request, project_pk: int) -> Response: # type: ignore[
279285 url_parts = summary .repository_url .rstrip ("/" ).split ("/" )
280286 repo_path = "/" .join (url_parts [- 2 :]) # e.g. "group/project"
281287
282- if not gitlab_config .project_name or not gitlab_config .project_name .endswith (repo_path ):
288+ if not gitlab_config .project_name or not gitlab_config .project_name .endswith (
289+ repo_path
290+ ):
283291 continue
284292
285293 if not gitlab_config .gitlab_project_id :
0 commit comments