Display confirmation if zeroid already exists

This commit is contained in:
HelloZeroNet 2016-04-09 19:49:12 +02:00
parent 561bd80aa3
commit 9bb0a0d91b
4 changed files with 40 additions and 6 deletions

View file

@ -110,10 +110,7 @@ class User(object):
}
# Check if we have already cert for that domain and its not the same
if self.certs.get(domain) and self.certs[domain] != cert_node:
raise Exception(
"You already have certificate for this domain: %s/%s@%s" %
(self.certs[domain]["auth_type"], self.certs[domain]["auth_user_name"], domain)
)
return False
elif self.certs.get(domain) == cert_node: # Same, not updated
return None
else: # Not exist yet, add
@ -121,6 +118,10 @@ class User(object):
self.save()
return True
# Remove cert from user
def deleteCert(self, domain):
del self.certs[domain]
# Set active cert for a site
def setCert(self, address, domain):
site_data = self.getSiteData(address)