@@ -50,6 +50,7 @@ class PreserveIPs:
5050
5151UpdateAction = SetIPs | UpdateWithSubnet | PreserveIPs
5252
53+
5354class 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