Skip to content
Snippets Groups Projects
Commit 280df8b8 authored by Nico's avatar Nico
Browse files

Check if password is empty on registration

parent 78343830
No related branches found
No related tags found
No related merge requests found
...@@ -93,6 +93,9 @@ class RegistrationContainer(Container): ...@@ -93,6 +93,9 @@ class RegistrationContainer(Container):
# pylint: disable=unused-argument # pylint: disable=unused-argument
def on_create_account_pressed(self, button): def on_create_account_pressed(self, button):
if self._password_is_empty():
self._show_error_message(_("Please enter a password"))
return
if not self._passwords_match(): if not self._passwords_match():
self._show_error_message(_("The passwords do not match")) self._show_error_message(_("The passwords do not match"))
return return
...@@ -102,6 +105,10 @@ class RegistrationContainer(Container): ...@@ -102,6 +105,10 @@ class RegistrationContainer(Container):
self._show_loading_animation() self._show_loading_animation()
self._register() self._register()
def _password_is_empty(self):
password = self.builder.get_object("password_entry").get_text()
return len(password) == 0
def _passwords_match(self): def _passwords_match(self):
password = self.builder.get_object("password_entry").get_text() password = self.builder.get_object("password_entry").get_text()
password_confirm = self.builder.get_object( password_confirm = self.builder.get_object(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment