Skip to content

Commit

Permalink
Merge pull request RedHatInsights#936 from petracihalova/rbac-api-fix
Browse files Browse the repository at this point in the history
RBAC small fixes, unused variables, unreachable code
  • Loading branch information
lpichler authored Oct 17, 2023
2 parents cc30153 + 7dcf4c6 commit 7fcffef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion rbac/api/common/exception_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def custom_exception_handler(exc, context):
error_response = {"errors": errors}
response.data = error_response
elif isinstance(exc, IntegrityError):
data = context.get("request").data
source_view = context.get("view")
response = Response(
{
Expand Down
3 changes: 1 addition & 2 deletions rbac/api/openapi/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import gzip
import json

from rest_framework import permissions, status
from rest_framework import permissions
from rest_framework.decorators import api_view, permission_classes, renderer_classes
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
Expand All @@ -38,4 +38,3 @@ def openapi(request):
with gzip.open(openapidoc) as api_file:
data = json.load(api_file)
return Response(data)
return Response(status=status.HTTP_404_NOT_FOUND)
3 changes: 1 addition & 2 deletions rbac/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def extract_header(request, header):
Decoded(dict): Identity dictionary
"""
rh_auth_header = request.META[header]
decoded_rh_auth = None
try:
decoded_rh_auth = b64decode(rh_auth_header)
except binascii.Error as err:
Expand All @@ -67,7 +66,7 @@ def extract_header(request, header):
rh_auth_header = add_padding(rh_auth_header)
decoded_rh_auth = b64decode(rh_auth_header)
json_rh_auth = json_loads(decoded_rh_auth)
return (rh_auth_header, json_rh_auth)
return rh_auth_header, json_rh_auth


def create_tenant_name(account):
Expand Down

0 comments on commit 7fcffef

Please sign in to comment.