Skip to content

Commit

Permalink
restore exception if string does not end in .intent
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 29, 2023
1 parent a904f36 commit 8e57433
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,9 @@ def register_intent(self, intent_parser: Union[IntentBuilder, Intent, str],
file to parse utterance for the handler.
handler (func): function to register with intent
"""
if (isinstance(intent_parser, str) and
intent_parser.endswith('.intent')):
if isinstance(intent_parser, str):
if not intent_parser.endswith('.intent'):
raise ValueError
return self.register_intent_file(intent_parser, handler)
return self._register_adapt_intent(intent_parser, handler)

Expand Down

0 comments on commit 8e57433

Please sign in to comment.