From 09c8ac611f14b19febcda1444cf42de4ee629664 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 25 Dec 2024 11:27:04 +0100 Subject: [PATCH] fixing for ruff #498 --- sipa/model/pycroft/user.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sipa/model/pycroft/user.py b/sipa/model/pycroft/user.py index 8dc82807..1324beeb 100644 --- a/sipa/model/pycroft/user.py +++ b/sipa/model/pycroft/user.py @@ -3,7 +3,6 @@ import json import logging from datetime import date -from typing import List from pydantic import ValidationError @@ -349,7 +348,7 @@ def add_mpsks_client(self, name, mac, password): name) if status == 400: - raise ValueError(f"Execceds maximum clients") + raise ValueError("Execceds maximum clients") elif status == 409: raise MacAlreadyExists elif status == 422: @@ -357,8 +356,8 @@ def add_mpsks_client(self, name, mac, password): try: response = json.loads(response) - except json.decoder.JSONDecodeError: - raise ValueError(f"Invalid response from {response}") + except json.decoder.JSONDecodeError as err: + raise ValueError(f"Invalid response from {response}") from err if ('name', 'mac', 'id') in response.keys(): return MPSKClientEntry(name=response.get('name'), mac=response.get('mac'), id=response.get('id'))