mirror of https://gitlab.crans.org/bde/nk20
Fix alias deletion
This commit is contained in:
parent
a9da4a38e1
commit
08c8792aed
|
@ -82,9 +82,10 @@ class AliasViewSet(ReadProtectedModelViewSet):
|
||||||
:return: The filtered set of requested aliases
|
:return: The filtered set of requested aliases
|
||||||
"""
|
"""
|
||||||
|
|
||||||
queryset = super().get_queryset()
|
queryset = super().get_queryset().distinct()
|
||||||
|
|
||||||
alias = self.request.query_params.get("alias", ".*")
|
alias = self.request.query_params.get("alias", None)
|
||||||
|
if alias:
|
||||||
queryset = queryset.filter(
|
queryset = queryset.filter(
|
||||||
name__iregex="^" + alias
|
name__iregex="^" + alias
|
||||||
).union(
|
).union(
|
||||||
|
|
Loading…
Reference in New Issue