Skip to content

Commit

Permalink
fixing for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
agmes4 committed Dec 25, 2024
1 parent a59188a commit 09c8ac6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sipa/model/pycroft/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import logging
from datetime import date
from typing import List

from pydantic import ValidationError

Expand Down Expand Up @@ -349,16 +348,16 @@ 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:
raise ValueError

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'))
Expand Down

0 comments on commit 09c8ac6

Please sign in to comment.