Skip to content

Commit

Permalink
mailman2: sort lists, allow subscription to public lists
Browse files Browse the repository at this point in the history
  • Loading branch information
timhawes committed Jan 11, 2024
1 parent 0ec5c75 commit 0c4cbec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mailman2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,22 @@ def build_overview_context(user):
}

mailinglists = []
for mailing_list in MailingList.objects.all():
for mailing_list in MailingList.objects.order_by("name"):
list_data = {
# "obj": mailing_list,
"name": mailing_list.name,
"description": mailing_list.description,
"archive_private": mailing_list.archive_private,
"visible": False,
"visible": mailing_list.user_can_see(user),
"subscribed": False,
"recommended": False,
"can_subscribe": False,
"can_subscribe": mailing_list.user_can_subscribe(user),
"can_unsubscribe": False,
"subscriptions": [],
}
row = 0
for address in verified_addresses:
group_policy = mailing_list.user_subscribe_policy(user)
if mailing_list.advertised:
list_data["visible"] = True
if group_policy:
if group_policy.policy >= GroupPolicy.ALLOW:
list_data["visible"] = True
Expand Down

0 comments on commit 0c4cbec

Please sign in to comment.