Merge Request #40
← To merge requests
From
private_mailman_lists
into
master
Private mailman lists
Only show public lists by default. Private lists are only visible if user if a member of that list. That applies to /dashboard /archives/thread and /accounts/username pages. So you cannot view a collaboration of an user in a private-list in their profile if you are not also in the privatelist. Note: You'll need mailman-api running to see this functionality. The tests uses mocked data from the mailman-api.
Commits (13)
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Carolina Ramalho <carol15022@hotmail.com>
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
-
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
- 8 of 13 commits displayed. Click here to show all
-
@rodrigosiqueiramelo @carlospecter
-
Why are you initializing the same variable twice with the same value and no other change between the redefinitions?
-
Why not use address_list function instead of mailing_lists? It returns mailing_lists too, but it's only used once in the file.
-
Same here about the usage of address_lists.
-
ALL done.
started a discussion
on the diff
colab/accounts/utils/mailman.py
97 | 102 | return [] |
98 | 103 | |
99 | 104 | return users.json() |
105 | + | |
106 | + | |
107 | +def get_user_mailinglists(user): | |
108 | + lists_for_user = [] | |
109 | + emails = '' | |
110 | + | |
111 | + if user: | |
112 | + emails = user.emails.values_list('address', flat=True) | |
113 | + | |
114 | + lists_for_user = [] | |
1 |
|
started a discussion
on the diff
colab/accounts/utils/mailman.py
38 | 38 | |
39 | 39 | |
40 | 40 | def update_subscription(address, lists): |
41 | - current_lists = address_lists(address) | |
41 | + current_lists = mailing_lists(address=address) | |
1 |
|
started a discussion
on the diff
colab/accounts/utils/mailman.py
66 | 67 | |
68 | +def is_private_list(name): | |
69 | + return dict(all_lists(private=True))[name] | |
70 | + | |
71 | + | |
67 | 72 | def all_lists(*args, **kwargs): |
68 | - return address_lists('', *args, **kwargs) | |
73 | + return mailing_lists(*args, **kwargs) | |
69 | 74 | |
70 | 75 | |
71 | 76 | def user_lists(user): |
72 | 77 | list_set = set() |
73 | 78 | |
74 | 79 | for email in user.emails.values_list('address', flat=True): |
75 | - list_set.update(address_lists(email)) | |
80 | + list_set.update(mailing_lists(address=email)) | |
1 |
|