Commit 0bf406ca55d5925dec05105b97f158ced6e24bf5
1 parent
5046caaf
Exists in
master
and in
27 other branches
Fix flake8
Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Showing
3 changed files
with
12 additions
and
9 deletions
Show diff stats
colab/accounts/utils/mailman.py
... | ... | @@ -4,7 +4,6 @@ import requests |
4 | 4 | import logging |
5 | 5 | |
6 | 6 | from django.conf import settings |
7 | -from django.contrib import messages | |
8 | 7 | |
9 | 8 | TIMEOUT = 1 |
10 | 9 | |
... | ... | @@ -16,14 +15,17 @@ E = 'error' |
16 | 15 | |
17 | 16 | MAILMAN_MSGS = { |
18 | 17 | 0: (S, '%s: Success!'), |
19 | - 1: (S, '%s: An email confirmation was sent to you, please check your inbox.'), | |
20 | - 2: (I, '%s: Your subscription was sent successfully! Please wait for the list\'s admin approval.'), | |
18 | + 1: (S, '%s: An email confirmation was sent to you, please check your \ | |
19 | +inbox.'), | |
20 | + 2: (I, '%s: Your subscription was sent successfully! Please wait for the \ | |
21 | +list\'s admin approval.'), | |
21 | 22 | 3: (I, '%s: You are already a member of this list.'), |
22 | 23 | 4: (E, '%s: You are banned from this list!'), |
23 | 24 | 5: (E, '%s: You appear to have an invalid email address.'), |
24 | 25 | 6: (E, '%s: Your email address is considered to be hostile.'), |
25 | 26 | 7: (E, '%s: You are not a member of this list.'), |
26 | - 8: (E, 'Missing information: `email_from`, `subject` and `body` are mandatory.'), | |
27 | + 8: (E, 'Missing information: `email_from`, `subject` and `body` are \ | |
28 | +mandatory.'), | |
27 | 29 | } |
28 | 30 | |
29 | 31 | |
... | ... | @@ -48,7 +50,8 @@ def subscribe(listname, address): |
48 | 50 | def unsubscribe(listname, address): |
49 | 51 | url = get_url('subscribe/', listname) |
50 | 52 | try: |
51 | - result = requests.delete(url, timeout=TIMEOUT, data={'address': address}) | |
53 | + result = requests.delete(url, timeout=TIMEOUT, data={'address': | |
54 | + address}) | |
52 | 55 | msg_type, message = MAILMAN_MSGS[result.json()] |
53 | 56 | return msg_type, message % listname |
54 | 57 | except: | ... | ... |
colab/accounts/views.py
... | ... | @@ -149,7 +149,6 @@ class ManageUserSubscriptionsView(UserProfileBaseMixin, DetailView): |
149 | 149 | show_message = getattr(messages, msg_type) |
150 | 150 | show_message(request, _(message)) |
151 | 151 | |
152 | - | |
153 | 152 | return redirect('user_profile', username=user.username) |
154 | 153 | |
155 | 154 | def get_context_data(self, **kwargs): |
... | ... | @@ -162,7 +161,8 @@ class ManageUserSubscriptionsView(UserProfileBaseMixin, DetailView): |
162 | 161 | |
163 | 162 | for email in emails: |
164 | 163 | lists = [] |
165 | - lists_for_address = mailman.mailing_lists(address=email, names_only=True) | |
164 | + lists_for_address = mailman.mailing_lists(address=email, | |
165 | + names_only=True) | |
166 | 166 | for mlist in all_lists: |
167 | 167 | if mlist.get('listname') in lists_for_address: |
168 | 168 | checked = True |
... | ... | @@ -170,7 +170,7 @@ class ManageUserSubscriptionsView(UserProfileBaseMixin, DetailView): |
170 | 170 | checked = False |
171 | 171 | lists.append(( |
172 | 172 | {'listname': mlist.get('listname'), |
173 | - 'description': mlist.get('description')}, | |
173 | + 'description': mlist.get('description')}, | |
174 | 174 | checked |
175 | 175 | )) |
176 | 176 | ... | ... |
colab/plugins/gitlab/tests/test_gitlab.py