diff --git a/api/tacticalrmm/ee/sso/views.py b/api/tacticalrmm/ee/sso/views.py index 5dc85c55..d7d69099 100644 --- a/api/tacticalrmm/ee/sso/views.py +++ b/api/tacticalrmm/ee/sso/views.py @@ -96,9 +96,7 @@ class GetAddSSOProvider(APIView): # removed any special characters and replaces spaces with a hyphen def generate_provider_id(self, string): - id = re.sub(r"[^A-Za-z0-9\s]", "", string) - id = id.replace(" ", "-") - return id + return re.sub(r"[^A-Za-z0-9\s]", "", string).replace(" ", "-") def post(self, request): data = request.data @@ -106,7 +104,7 @@ class GetAddSSOProvider(APIView): # need to move server_url into json settings data["settings"] = {} data["settings"]["server_url"] = data["server_url"] - data["settings"]["role"] = data["role"] if data["role"] else None + data["settings"]["role"] = data["role"] or None # set provider to 'openid_connect' data["provider"] = "openid_connect" @@ -138,7 +136,7 @@ class GetUpdateDeleteSSOProvider(APIView): # need to move server_url into json settings data["settings"] = {} data["settings"]["server_url"] = data["server_url"] - data["settings"]["role"] = data["role"] if data["role"] else None + data["settings"]["role"] = data["role"] or None serializer = self.InputSerialzer(instance=provider, data=data, partial=True) serializer.is_valid(raise_exception=True) diff --git a/api/tacticalrmm/logs/models.py b/api/tacticalrmm/logs/models.py index ebb15b29..13448c65 100644 --- a/api/tacticalrmm/logs/models.py +++ b/api/tacticalrmm/logs/models.py @@ -474,7 +474,7 @@ class PendingAction(models.Model): PAAction.RUN_PATCH_SCAN, PAAction.RUN_PATCH_INSTALL, ): - return f"{self.action_type}" + return str(self.action_type) return None