Closed pederhan closed 4 months ago
I tested this with mreg-cli from the migrate_to_pydandic
branch (248a19e) and verified that the "zone create" commands in the testsuite work now.
- zone.primary_ns = request.data.getlist('primary_ns')[0] + zone.primary_ns = nameservers[0]
I'm not going to pretend that I understand why we're simply picking the first one, but the PR retains behaviour and fixes the issue with content type management. That works for me. :)
It is due to https://github.com/unioslo/mreg/blob/b4975799aaa18905e704182cead4f990aaad896a/mreg/models/zone.py#L58 We (ab)use the first name server in the list to be used as mname server in the SOA record for the zone.
The zone's primary_ns
field could possibly be changed to mname
to better reflect usage.
We (ab)use the first name server in the list to be used as mname server in the SOA record for the zone.
Now that I know I wish I didn't know. :)
The zone's
primary_ns
field could possibly be changed tomname
to better reflect usage.
Yep.
Checks content type before trying to call
getlist
on request data.