Display confirmation if zeroid already exists
This commit is contained in:
parent
561bd80aa3
commit
9bb0a0d91b
4 changed files with 40 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue