Skip to content

Commit

Permalink
ui, rules editor: fixed editing/adding rules
Browse files Browse the repository at this point in the history
There was a race condition that caused several problems when editing or
adding rules.

for rules of type "list", the operand must be "list" as well.

related: #429 #425
  • Loading branch information
gustavo-iniguez-goya committed May 31, 2021
1 parent e5b54f0 commit 95a30c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/opensnitch/dialogs/ruleseditor.py
Expand Up @@ -168,6 +168,9 @@ def get_rule_from_records(self, records):
return rule

def _reset_state(self):
self._old_rule_name = None
self.rule = None

self.ruleNameEdit.setText("")
self.statusLabel.setText("")

Expand Down Expand Up @@ -550,7 +553,7 @@ def _save_rule(self):

if len(rule_data) > 1:
self.rule.operator.type = "list"
self.rule.operator.operand = ""
self.rule.operator.operand = "list"
self.rule.operator.data = json.dumps(rule_data)
else:
self.rule.operator.operand = rule_data[0]['operand']
Expand Down

0 comments on commit 95a30c4

Please sign in to comment.