VirtualMailManager/handler.py
branchv0.6.x
changeset 557 1498abbb6c91
parent 555 499c63f52462
child 559 cc0f67f99780
--- a/VirtualMailManager/handler.py	Thu May 31 18:48:00 2012 +0000
+++ b/VirtualMailManager/handler.py	Thu Jun 14 16:06:09 2012 +0000
@@ -480,8 +480,20 @@
         serviceset = ServiceSet(self._dbh, **kwargs)
         dom.update_serviceset(serviceset, (True, False)[not force])
 
+    def domain_transport(self, domainname, transport, force=None):
+        """Wrapper around Domain.update_transport()"""
+        if force is not None and force != 'force':
+            raise DomainError(_(u"Invalid argument: '%s'") % force,
+                              INVALID_ARGUMENT)
+        dom = self._get_domain(domainname)
+        trsp = Transport(self._dbh, transport=transport)
+        if force is None:
+            dom.update_transport(trsp)
+        else:
+            dom.update_transport(trsp, force=True)
+
     def domain_note(self, domainname, note):
-        """Wrapper around Domain.update_transport()"""
+        """Wrapper around Domain.update_note()"""
         dom = self._get_domain(domainname)
         dom.update_note(note)