Skip to content

Commit

Permalink
ui: fixed exporting rules to the clipboard
Browse files Browse the repository at this point in the history
We were not formatting the "created" date field properly.
More info: #1140 (comment)

(cherry picked from commit b096e66)
  • Loading branch information
gustavo-iniguez-goya committed Jun 13, 2024
1 parent 496e905 commit 0fc4239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/opensnitch/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def rule_to_json(self, node, rule_name):
# exclude this field when exporting to json
tempRule = MessageToJson(rule)
jRule = json.loads(tempRule)
jRule['created'] = str(datetime.fromtimestamp(
rule.created).strftime("%Y-%m-%d %H:%M:%S")
jRule['created'] = "{0}Z".format(
datetime.fromtimestamp(rule.created).isoformat(timespec='microseconds')
)
return json.dumps(jRule, indent=" ")
except Exception as e:
Expand Down

0 comments on commit 0fc4239

Please sign in to comment.