Skip to content

Commit

Permalink
Merge pull request #8 from internetstandards/domain_normalization
Browse files Browse the repository at this point in the history
document why a certain output order is not used
  • Loading branch information
stitch authored Nov 7, 2024
2 parents 3a328d3 + 4763591 commit 1f60337
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ctlssa/suggestions/logic/suggest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ def suggest_subdomains(domain: str, suffix: str = "nl", period_in_days: int = 36
last_seen__gte=some_time_ago,
).values_list("subdomain", flat=True)

# use reverse string sorting to get subdomains in the correct order:
# a.amsterdam.basis.nl
# b.amsterdam.basis.nl
# a.zutphen.basis.nl
# this is very hard to understand for normal users, this might be sorting option in the UI but should not be
# the default.
# domains = set(query)
# sorted_data = [domain[::-1] for domain in domains]
# sorted_data.sort()
# [domain[::-1] for domain in sorted_data]
return sorted(set(query))

0 comments on commit 1f60337

Please sign in to comment.