Skip to content

Commit

Permalink
Check that user email is valid instead of non-null (#52)
Browse files Browse the repository at this point in the history
* Check that user email is valid instead of non-null
Relates to #51

* Update skill.json

---------

Co-authored-by: NeonDaniel <NeonDaniel@users.noreply.github.com>
  • Loading branch information
NeonDaniel and NeonDaniel committed Mar 21, 2023
1 parent 7e92ea9 commit e4ca94d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from neon_utils.skills.neon_skill import NeonSkill
from neon_utils.net_utils import get_ip_address
from neon_utils.file_utils import encode_file_to_base64_string
from neon_utils.parse_utils import validate_email
from ovos_utils import classproperty
from ovos_utils.log import LOG
from ovos_utils.process_utils import RuntimeRequirements
Expand Down Expand Up @@ -76,7 +77,7 @@ def handle_contact_support(self, message: Message):
"""
user_profile = get_user_prefs(message)
email_addr = user_profile["user"]["email"]
if not email_addr:
if not validate_email(email_addr):
self.speak_dialog("no_email", private=True)
email_addr = self.support_email
if self.ask_yesno("confirm_support",
Expand Down Expand Up @@ -172,10 +173,10 @@ def _check_service_status(self, message: Message = None) -> dict:
gui_status = gui_module.data.get("status") if gui_module \
else None

enclosure_module = self.bus.wait_for_response(
phal_module = self.bus.wait_for_response(
message.forward("mycroft.PHAL.is_ready")
)
enclosure_status = enclosure_module.data.get("status") if enclosure_module \
enclosure_status = phal_module.data.get("status") if phal_module \
else None

admin_module = self.bus.wait_for_response(
Expand All @@ -191,7 +192,8 @@ def _check_service_status(self, message: Message = None) -> dict:
"enclosure": enclosure_status,
"admin": admin_status}

def _get_log_files(self):
@staticmethod
def _get_log_files():
log_path = LOG.base_path
log_files = glob(join(log_path, "*.log"))
LOG.info(f"Found log files: {log_files}")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
neon-utils[network]~=1.1
neon-utils[network]~=1.1,>=1.2.5a3
ovos_utils~=0.0.28
2 changes: 1 addition & 1 deletion skill.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"systemDeps": false,
"requirements": {
"python": [
"neon-utils[network]~=1.1",
"neon-utils[network]~=1.1,>=1.2.5a3",
"ovos_utils~=0.0.28"
],
"system": {},
Expand Down

0 comments on commit e4ca94d

Please sign in to comment.