summaryrefslogtreecommitdiff
path: root/src/mailman/rest/domains.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-04-19 12:41:17 -0400
committerBarry Warsaw2011-04-19 12:41:17 -0400
commitb6b5825bf19e6fb9c5f13ffe2558c1a3531b8b85 (patch)
tree981f78b59c682b122c9b9479e4421d95a32b0247 /src/mailman/rest/domains.py
parentc0c2ae64dd48f95a57669395c315e84c992fc332 (diff)
downloadmailman-b6b5825bf19e6fb9c5f13ffe2558c1a3531b8b85.tar.gz
mailman-b6b5825bf19e6fb9c5f13ffe2558c1a3531b8b85.tar.zst
mailman-b6b5825bf19e6fb9c5f13ffe2558c1a3531b8b85.zip
Diffstat (limited to 'src/mailman/rest/domains.py')
-rw-r--r--src/mailman/rest/domains.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mailman/rest/domains.py b/src/mailman/rest/domains.py
index edb72af61..780380270 100644
--- a/src/mailman/rest/domains.py
+++ b/src/mailman/rest/domains.py
@@ -31,7 +31,7 @@ from zope.component import getUtility
from mailman.interfaces.domain import (
BadDomainSpecificationError, IDomainManager)
-from mailman.rest.helpers import CollectionMixin, etag, path_to
+from mailman.rest.helpers import CollectionMixin, etag, no_content, path_to
from mailman.rest.validator import Validator
@@ -69,6 +69,16 @@ class ADomain(_DomainBase):
return http.not_found()
return http.ok([], self._resource_as_json(domain))
+ @resource.DELETE()
+ def delete(self, request):
+ """Delete the domain."""
+ try:
+ getUtility(IDomainManager).remove(self._domain)
+ except KeyError:
+ # The domain does not exist.
+ return http.not_found()
+ return no_content()
+
class AllDomains(_DomainBase):
"""The domains."""