Skip to content

Commit bf816c5

Browse files
committed
fmt(api): Fix formatting issues
1 parent 0b764f7 commit bf816c5

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

api/desecapi/tests/test_dyndns12update.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,7 @@ def test_update_multiple_with_extra(self):
369369
domain1 = "sub1." + self.my_domain.name
370370
domain2 = "sub2." + self.my_domain.name
371371
domain3 = "sub3." + self.my_domain.name
372-
self.create_rr_set(
373-
self.my_domain, [old_ip4], subname="sub2", type="A", ttl=60
374-
)
372+
self.create_rr_set(self.my_domain, [old_ip4], subname="sub2", type="A", ttl=60)
375373

376374
with self.assertRequests(
377375
self.request_pdns_zone_update(self.my_domain.name),

api/desecapi/views/domains.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ def zonefile(self, request, name=None):
139139

140140
class SerialListView(APIView):
141141
permission_classes = (permissions.IsVPNClient,)
142-
throttle_classes = [] # don't break secondaries when they ask too often (our cached responses are cheap)
142+
throttle_classes = (
143+
[]
144+
) # don't break secondaries when they ask too often (our cached responses are cheap)
143145

144146
def get(self, request, *args, **kwargs):
145147
key = "desecapi.views.serials"

api/desecapi/views/dyndns.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class PreserveIPs:
5050

5151
UpdateAction = SetIPs | UpdateWithSubnet | PreserveIPs
5252

53+
5354
class DynDNS12UpdateView(generics.GenericAPIView):
5455
authentication_classes = (
5556
TokenAuthentication,
@@ -98,7 +99,9 @@ def _find_action(self, param_keys, separator) -> UpdateAction:
9899
return SetIPs(ips=[])
99100

100101
@staticmethod
101-
def _get_action_from_param(param_key: str, param_value: str, separator: str) -> UpdateAction | None:
102+
def _get_action_from_param(
103+
param_key: str, param_value: str, separator: str
104+
) -> UpdateAction | None:
102105
"""
103106
Parses a single query parameter value to determine the DynDNS update action.
104107
@@ -125,7 +128,7 @@ def _get_action_from_param(param_key: str, param_value: str, separator: str) ->
125128
params = set(
126129
filter(
127130
lambda param: separator in param or param in ("", "preserve"),
128-
map(str.strip, param_value.split(","))
131+
map(str.strip, param_value.split(",")),
129132
)
130133
)
131134
if not params:
@@ -291,10 +294,11 @@ def extra_actions(self) -> dict[tuple[str, str], UpdateAction]:
291294
and values are `UpdateAction` instances (SetIPs, UpdateWithSubnet, PreserveIPs).
292295
"""
293296
return {
294-
(type_, qname.rpartition(f".{self.domain.name}")[0]): self._get_action_from_param(
295-
qname,
296-
argument,
297-
"." if type_ == "A" else ":"
297+
(
298+
type_,
299+
qname.rpartition(f".{self.domain.name}")[0],
300+
): self._get_action_from_param(
301+
qname, argument, "." if type_ == "A" else ":"
298302
)
299303
for qname, arguments in self.extra_qnames.items()
300304
for type_, argument in arguments.items()
@@ -310,7 +314,7 @@ def get_serializer_context(self):
310314
def get_queryset(self):
311315
subnames = [
312316
*self.subnames,
313-
*[subname for (type_, subname) in self.extra_actions.keys()]
317+
*[subname for (type_, subname) in self.extra_actions.keys()],
314318
]
315319
return self.domain.rrset_set.filter(
316320
subname__in=subnames, type__in=["A", "AAAA"]

0 commit comments

Comments
 (0)