Only display sign error if there is no stored privatekey

This commit is contained in:
shortcutme 2019-05-29 16:03:10 +02:00
parent 589869c5ed
commit a2d29a4531
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -461,10 +461,11 @@ class UiWebsocket(object):
if privatekey == "stored": # Get privatekey from sites.json
privatekey = self.user.getSiteData(self.site.address).get("privatekey")
self.cmd("notification", ["error", _["Content signing failed"] + "<br><small>Private key not found in sites.json </small>"])
self.response(to, {"error": "Site sign failed: Private key not stored."})
self.log.error("Site sign failed: %s: Private key not stored in sites.json" % inner_path)
return
if not privatekey:
self.cmd("notification", ["error", _["Content signing failed"] + "<br><small>Private key not found in sites.json </small>"])
self.response(to, {"error": "Site sign failed: Private key not stored."})
self.log.error("Site sign failed: %s: Private key not stored in sites.json" % inner_path)
return
if not privatekey: # Get privatekey from users.json auth_address
privatekey = self.user.getAuthPrivatekey(self.site.address)