Skip to content

Commit 729385c

Browse files
author
kntsoriano
committed
Allow empty name for records
1 parent f79d449 commit 729385c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dnsimple/struct/zone_record.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ def __init__(self, name, type, content, ttl=None, priority=None, regions=None):
2525
dict.__init__(self, name=name, type=type, content=content, ttl=ttl, priority=priority, regions=regions)
2626

2727
def to_json(self):
28-
return json.dumps(omitempty(self))
28+
omitted = omitempty(self)
29+
30+
if self['name'] is '':
31+
omitted['name'] = ''
2932

33+
return json.dumps(omitted)
3034

3135
@dataclass
3236
class ZoneRecord(Struct):

0 commit comments

Comments
 (0)