apply_changes handles commit message

This commit is contained in:
nemunaire 2023-12-10 12:12:43 +01:00
parent c32633ba09
commit d14552dd78

View File

@ -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: