WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 1289d78

Browse files
committed
Fixed cllassmethod typing not py3.12 compatible
1 parent b076e3b commit 1289d78

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.3]
8+
## [1.3.1] - 2025-12-04
9+
10+
### Fixed
11+
12+
- Classmethod typing not py3.12 compatible
13+
14+
## [1.3] - 2025-12-03
915

1016
### Changed
1117

1218
- Using alpine python (3.12) instead of 3.14 from uv (#3)
1319

14-
## [1.2]
20+
## [1.2] - 2025-12-01
1521

1622
### Fixed
1723

src/adminui/optional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Annotated
1+
from typing import Annotated, Self
22

33
from fastapi import APIRouter, Depends, Form, Request, Response
44
from fastapi.templating import Jinja2Templates
@@ -28,8 +28,8 @@ class OptionalFormData(BaseModel):
2828
model_config = {"extra": "forbid"}
2929

3030
@classmethod
31-
def ctx_defaults(cls) -> OptionalFormData:
32-
return OptionalFormData(sshd=context.sshd_enabled, kiosk=context.kiosk_enabled)
31+
def ctx_defaults(cls) -> Self:
32+
return cls(sshd=context.sshd_enabled, kiosk=context.kiosk_enabled)
3333

3434
def validate(self) -> ValidateResult:
3535
errors: dict[str, str] = {}

src/adminui/wifi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Annotated
1+
from typing import Annotated, Self
22

33
from fastapi import APIRouter, Depends, Form, Request, Response
44
from fastapi.templating import Jinja2Templates
@@ -34,8 +34,8 @@ class WifiFormData(BaseModel):
3434
model_config = {"extra": "forbid"}
3535

3636
@classmethod
37-
def ctx_defaults(cls) -> WifiFormData:
38-
return WifiFormData(
37+
def ctx_defaults(cls) -> Self:
38+
return cls(
3939
profile=context.wifi_profile,
4040
ssid=context.wifi_ssid,
4141
open=context.wifi_open,

0 commit comments

Comments
 (0)