Skip to content

Commit

Permalink
๐Ÿ›  fix: global action form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomy0000000 committed Dec 19, 2022
1 parent 4efb32b commit 7ed66f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tubee/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class ActionForm(FlaskForm):
def validate_automate(self, field):
if not self.channel_id.data and not self.tag_id.data and field.data:
field.errors = ["Automate can only be enabled for channels or tags"]
return False
return True

def validate(self):
if not self.action_name.validate(self) or not self.action_type.validate(self):
Expand Down

0 comments on commit 7ed66f1

Please sign in to comment.