Skip to content

Commit

Permalink
Refactor to resolve reference error https://github.com/NeonGeckoCom/N…
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed May 6, 2024
1 parent e736282 commit f4fd6bd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2435,13 +2435,12 @@ def disable_intent(self, intent_name: str) -> bool:
"""
if intent_name in self.intent_service:
self.log.info('Disabling intent ' + intent_name)
name = f'{self.skill_id}:{intent_name}'
self.intent_service.detach_intent(name)
self.intent_service.remove_intent(intent_name)

langs = [self.core_lang] + self.secondary_langs
for lang in langs:
lang_intent_name = f'{name}_{lang}'
self.intent_service.detach_intent(lang_intent_name)
lang_intent_name = f'{intent_name}_{lang}'
self.intent_service.remove_intent(lang_intent_name)
return True
else:
self.log.error(f'Could not disable {intent_name}, it hasn\'t been registered.')
Expand Down

0 comments on commit f4fd6bd

Please sign in to comment.