pre-release-changes #14

Merged
Typhus merged 17 commits from pre-release-changes into main 2025-03-25 23:07:43 +00:00
Showing only changes of commit 49d89feda3 - Show all commits

View File

@ -13,7 +13,7 @@ logger = logging.getLogger(__name__.split(".")[-1])
class RegisterPage(Component):
def on_pw_change(self, _: TextInputChangeEvent) -> None:
def on_pw_focus_loss(self, _: TextInputChangeEvent) -> None:
if not (self.pw_1.text == self.pw_2.text) or len(self.pw_1.text) < MINIMUM_PASSWORD_LENGTH:
self.pw_1.is_valid = False
self.pw_2.is_valid = False
@ -21,14 +21,14 @@ class RegisterPage(Component):
self.pw_1.is_valid = True
self.pw_2.is_valid = True
def on_email_changed(self, change_event: TextInputChangeEvent) -> None:
def on_email_focus_loss(self, change_event: TextInputChangeEvent) -> None:
try:
validate_email(change_event.text, check_deliverability=False)
self.email_input.is_valid = True
except EmailNotValidError:
self.email_input.is_valid = False
def on_user_name_input_change(self, _: TextInputChangeEvent) -> None:
def on_user_name_focus_loss(self, _: TextInputChangeEvent) -> None:
current_text = self.user_name_input.text
if len(current_text) > UserService.MAX_USERNAME_LENGTH:
self.user_name_input.text = current_text[:UserService.MAX_USERNAME_LENGTH]
@ -100,7 +100,7 @@ class RegisterPage(Component):
margin_right=1,
margin_bottom=1,
grow_x=True,
on_change=self.on_user_name_input_change
on_lose_focus=self.on_user_name_focus_loss
)
self.email_input = TextInput(
label="E-Mail Adresse",
@ -109,7 +109,7 @@ class RegisterPage(Component):
margin_right=1,
margin_bottom=1,
grow_x=True,
on_change=self.on_email_changed
on_lose_focus=self.on_email_focus_loss
)
self.pw_1 = TextInput(
label="Passwort",
@ -119,7 +119,7 @@ class RegisterPage(Component):
margin_bottom=1,
grow_x=True,
is_secret=True,
on_change=self.on_pw_change
on_lose_focus=self.on_pw_focus_loss
)
self.pw_2 = TextInput(
label="Passwort wiederholen",
@ -129,7 +129,7 @@ class RegisterPage(Component):
margin_bottom=1,
grow_x=True,
is_secret=True,
on_change=self.on_pw_change
on_lose_focus=self.on_pw_focus_loss
)
self.submit_button = Button(
content=Text(