From 0655781c9469cd7124aab8fb36dda53e0ec7a2d8 Mon Sep 17 00:00:00 2001 From: krishnaglodha Date: Tue, 17 Sep 2024 16:51:03 +0530 Subject: [PATCH] fixed as black --- src/geoserverx/_sync/gsx.py | 12 ++++++------ src/geoserverx/models/geofence.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/geoserverx/_sync/gsx.py b/src/geoserverx/_sync/gsx.py index 71ca088..a39c276 100644 --- a/src/geoserverx/_sync/gsx.py +++ b/src/geoserverx/_sync/gsx.py @@ -115,15 +115,17 @@ def check_modules(self, name) -> Union[bool, GSResponse]: try: response = Client.get("about/status.json") response.raise_for_status() # Raises an HTTPError for bad responses (4xx and 5xx) - + # Extract and check the modules - modules = [item["name"].lower() for item in response.json()["statuss"]["status"]] + modules = [ + item["name"].lower() for item in response.json()["statuss"]["status"] + ] if name.lower() in modules: return True else: # Raise exception if the plugin is not found raise Exception("Plugin not found") - + except httpx.HTTPStatusError as e: # Handle HTTP errors (e.g., 4xx, 5xx) self.response_recognise(e.response.status_code) @@ -135,8 +137,6 @@ def check_modules(self, name) -> Union[bool, GSResponse]: # Handle any other exceptions return GSResponse(code=404, response=str(e)) - - # Get all workspaces @exception_handler def get_all_workspaces(self) -> Union[WorkspacesModel, GSResponse]: @@ -469,7 +469,7 @@ def get_all_layer_groups( def get_all_geofence_rules(self) -> Union[RulesResponse, GSResponse]: Client = self.http_client # Check if the geofence plugin exists - module_check= self.check_modules("geofence") + module_check = self.check_modules("geofence") # If the module check fails, return the GSResponse directly if isinstance(module_check, GSResponse): return module_check diff --git a/src/geoserverx/models/geofence.py b/src/geoserverx/models/geofence.py index 24d7d80..2a50371 100644 --- a/src/geoserverx/models/geofence.py +++ b/src/geoserverx/models/geofence.py @@ -24,7 +24,7 @@ class LayerDetails(BaseModel): class Rule(BaseModel): priority: int userName: Optional[str] = None - roleName: Optional[str] = None + roleName: Optional[str] = None addressRange: Optional[str] = None workspace: Optional[str] = None layer: Optional[str] = None