Compare commits

...

3 Commits

Author SHA1 Message Date
63fe8c9b80 Prepare 0.3.0
All checks were successful
continuous-integration/drone/tag Build is passing
2023-12-10 12:42:09 +01:00
d14552dd78 apply_changes handles commit message 2023-12-10 12:41:45 +01:00
c32633ba09 Handle domains with no history on domain_list 2023-12-10 11:58:07 +01:00
4 changed files with 8 additions and 5 deletions

View File

@ -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 []

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:

View File

@ -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" },
]

View File

@ -8,7 +8,7 @@ try:
except ImportError:
from distutils.core import setup
version = "0.2.0"
version = "0.3.0"
setup(
name = "happydomain",