diff --git a/happydomain/domain.py b/happydomain/domain.py index 5302178..1a87eea 100644 --- a/happydomain/domain.py +++ b/happydomain/domain.py @@ -15,7 +15,7 @@ class Domain: self.domain = domain self.group = group if zone_history_are_ids: - self.zone_history = [UncompleteZoneMeta(self, zid) for zid in zone_history] + self.zone_history = [UncompleteZoneMeta(self, zid) for zid in zone_history] if zone_history is not None else [] else: self.zone_history = zone_history if zone_history is not None else [] diff --git a/happydomain/zone.py b/happydomain/zone.py index ca3ff77..f79032f 100644 --- a/happydomain/zone.py +++ b/happydomain/zone.py @@ -144,7 +144,7 @@ class Zone(ZoneMeta): return r.json() - def apply_changes(self): + def apply_changes(self, message=""): rdiff = self._session.session.post( self._session.baseurl + "/api/domains/" + quote(self._domainid) + "/diff_zones/%40/" + quote(self.id), ) @@ -154,7 +154,10 @@ class Zone(ZoneMeta): r = self._session.session.post( self._session.baseurl + "/api/domains/" + quote(self._domainid) + "/zone/" + quote(self.id) + "/apply_changes", - data=rdiff.text + data=json.dumps({ + "wantedCorrections": json.loads(rdiff.text), + "commitMessage": message, + }) ) if r.status_code > 300: diff --git a/pyproject.toml b/pyproject.toml index cb8af0e..fef4f6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "happydomain" -version = "0.2.0" +version = "0.3.0" authors = [ { name="happyDomain's team", email="contact+pypi@happydomain.org" }, ] diff --git a/setup.py b/setup.py index 0dc2ead..7f90624 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ try: except ImportError: from distutils.core import setup -version = "0.2.0" +version = "0.3.0" setup( name = "happydomain",