Skip to content

Commit

Permalink
added mpsks clients
Browse files Browse the repository at this point in the history
added mpsk client to user profile
#498
  • Loading branch information
agmes4 committed Oct 27, 2024
1 parent 5845665 commit 5b9d0b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions sipa/blueprints/usersuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def index():
("mail_confirmed", [gettext("Status deiner E-Mail-Adresse")]),
("mail_forwarded", [gettext("E-Mail-Weiterleitung")]),
("wifi_password", [gettext("WLAN Passwort")]),
("mpsks_clients", [gettext("WLAN mpsks clients"),gettext("Für Geräte die kein WPA-Enterprise Unterstützen") ]),
# ('hostname', gettext("Hostname")),
# ('hostalias', gettext("Hostalias")),
("userdb_status", [gettext("MySQL Datenbank")]),
Expand Down
7 changes: 7 additions & 0 deletions sipa/model/pycroft/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class UserData(BaseModel):
membership_end_date: date | None
membership_begin_date: date | None
wifi_password: str | None
mpsk_clients: list[MPSKClientEntry]


class UserStatus(BaseModel):
Expand All @@ -55,3 +56,9 @@ class FinanceHistoryEntry(BaseModel):
valid_on: str
amount: Decimal
description: str


class MPSKClientEntry(BaseModel):
mac: str
name: str
id: int
6 changes: 3 additions & 3 deletions sipa/model/pycroft/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ def membership_end_date(self) -> ActiveProperty[date | None, date | None]:
capabilities=Capabilities.edit_if(self.is_member),
)

@poperty
def mpsks_clients(self) -> List[MPSK_Client]:
return
@property
def mpsks_clients(self) -> ActiveProperty[str | None, str | None]:
return ActiveProperty (name="mpsks_clients")

@property
def is_member(self) -> bool:
Expand Down
4 changes: 4 additions & 0 deletions sipa/model/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ def is_member(self) -> bool:
def wifi_password(self) -> PropertyBase[str, str | None]:
return UnsupportedProperty("wifi_password")

@property
def mpsks_clients(self) -> PropertyBase[str, str | None]:
return UnsupportedProperty("mpsks_clients")

@classmethod
def request_password_reset(cls, user_ident, email):
raise NotImplementedError
Expand Down

0 comments on commit 5b9d0b2

Please sign in to comment.