Skip to content

Commit

Permalink
mailman2: only allow subscription to public lists when advertised
Browse files Browse the repository at this point in the history
  • Loading branch information
timhawes committed Jan 11, 2024
1 parent 0c4cbec commit 364c521
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mailman2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ def build_overview_context(user):
"name": mailing_list.name,
"description": mailing_list.description,
"archive_private": mailing_list.archive_private,
"visible": mailing_list.user_can_see(user),
"visible": False,
"subscribed": False,
"recommended": False,
"can_subscribe": mailing_list.user_can_subscribe(user),
"can_subscribe": False,
"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 mailing_list.user_can_subscribe(user):
list_data["can_subscribe"] = True
if group_policy:
if group_policy.policy >= GroupPolicy.ALLOW:
list_data["visible"] = True
Expand Down

0 comments on commit 364c521

Please sign in to comment.