Commit 9b21da7ac95fd4de87cf88df34167f642df40611
1 parent
ad6b59ee
Exists in
detach_super_archives
Removing super_archives references from colab, it'll be tough
Showing
8 changed files
with
6 additions
and
166 deletions
Show diff stats
colab/accounts/templatetags/gravatar.py
1 | 1 | |
2 | 2 | from django import template |
3 | 3 | |
4 | -from colab.super_archives.models import EmailAddress | |
5 | - | |
6 | 4 | |
7 | 5 | register = template.Library() |
8 | 6 | |
9 | 7 | |
10 | 8 | @register.simple_tag(takes_context=True) |
11 | 9 | def gravatar(context, email, size=80): |
12 | - if isinstance(email, basestring): | |
13 | - try: | |
14 | - email = EmailAddress.objects.get(address=email) | |
15 | - except EmailAddress.DoesNotExist: | |
16 | - pass | |
17 | - | |
10 | + | |
18 | 11 | email_md5 = getattr(email, 'md5', 'anonymous') |
19 | 12 | |
20 | 13 | request = context.get('request') | ... | ... |
colab/accounts/views.py
... | ... | @@ -11,8 +11,6 @@ from django.core.exceptions import PermissionDenied |
11 | 11 | from django.views.generic import DetailView, UpdateView |
12 | 12 | from django.http import Http404 |
13 | 13 | |
14 | -from colab.super_archives.models import (EmailAddress, | |
15 | - EmailAddressValidation) | |
16 | 14 | from colab.search.utils import get_collaboration_data, get_visible_threads |
17 | 15 | from colab.accounts.models import User |
18 | 16 | |
... | ... | @@ -103,22 +101,6 @@ def signup(request): |
103 | 101 | |
104 | 102 | user.is_active = False |
105 | 103 | user.save() |
106 | - email = EmailAddressValidation.create(user.email, user) | |
107 | - | |
108 | - location = reverse('archive_email_view', | |
109 | - kwargs={'key': email.validation_key}) | |
110 | - verification_url = request.build_absolute_uri(location) | |
111 | - EmailAddressValidation.verify_email(email, verification_url) | |
112 | - | |
113 | - # Check if the user's email have been used previously | |
114 | - # in the mainling lists to link the user to old messages | |
115 | - email_addr, created = EmailAddress.objects.get_or_create( | |
116 | - address=user.email) | |
117 | - if created: | |
118 | - email_addr.real_name = user.get_full_name() | |
119 | - | |
120 | - email_addr.user = user | |
121 | - email_addr.save() | |
122 | 104 | |
123 | 105 | mailing_lists = lists_form.cleaned_data.get('lists') |
124 | 106 | mailman.update_subscription(user.email, mailing_lists) | ... | ... |
colab/home/views.py
... | ... | @@ -3,7 +3,6 @@ from django.shortcuts import render |
3 | 3 | from django.http import HttpResponse, Http404 |
4 | 4 | |
5 | 5 | from colab.search.utils import get_collaboration_data |
6 | -from colab.super_archives.models import Thread | |
7 | 6 | from colab.accounts.utils import mailman |
8 | 7 | from colab.accounts.models import User |
9 | 8 | |
... | ... | @@ -22,9 +21,9 @@ def get_user_threads(threads, lists_for_user, key): |
22 | 21 | def dashboard(request): |
23 | 22 | """Dashboard page""" |
24 | 23 | |
25 | - highest_score_threads = Thread.highest_score.all() | |
24 | + highest_score_threads = [] # TODO | |
26 | 25 | |
27 | - all_threads = Thread.objects.all() | |
26 | + all_threads = [] # TODO | |
28 | 27 | latest_threads = [] |
29 | 28 | lists_for_user = [] |
30 | 29 | ... | ... |
colab/rss/feeds.py
... | ... | @@ -6,15 +6,12 @@ from django.utils.translation import ugettext as _ |
6 | 6 | |
7 | 7 | from haystack.query import SearchQuerySet |
8 | 8 | |
9 | -from colab.super_archives.models import Thread | |
10 | - | |
11 | - | |
12 | 9 | class LatestThreadsFeeds(Feed): |
13 | 10 | title = _(u'Latest Discussions') |
14 | 11 | link = '/rss/threads/latest/' |
15 | 12 | |
16 | 13 | def items(self): |
17 | - return Thread.objects.all()[:20] | |
14 | + return [] | |
18 | 15 | |
19 | 16 | def item_link(self, item): |
20 | 17 | return item.latest_message.url |
... | ... | @@ -33,7 +30,7 @@ class HottestThreadsFeeds(Feed): |
33 | 30 | link = '/rss/threads/hottest/' |
34 | 31 | |
35 | 32 | def items(self): |
36 | - return Thread.highest_score.all()[:20] | |
33 | + return [] | |
37 | 34 | |
38 | 35 | def item_link(self, item): |
39 | 36 | return item.latest_message.url | ... | ... |
colab/search/fixtures/test_data.json
1 | 1 | [ |
2 | 2 | { |
3 | 3 | "fields": { |
4 | - "logo": "", | |
5 | - "description": "", | |
6 | - "last_imported_index": 0, | |
7 | - "name": "ListA", | |
8 | - "email": "listA@example.com" | |
9 | - }, | |
10 | - "model": "super_archives.mailinglist", | |
11 | - "pk": 1 | |
12 | -}, | |
13 | -{ | |
14 | - "fields": { | |
15 | - "logo": "", | |
16 | - "description": "", | |
17 | - "last_imported_index": 0, | |
18 | - "name": "ListB", | |
19 | - "email": "listB@example.com" | |
20 | - }, | |
21 | - "model": "super_archives.mailinglist", | |
22 | - "pk": 2 | |
23 | -}, | |
24 | -{ | |
25 | - "fields": { | |
26 | - "logo": "", | |
27 | - "description": "", | |
28 | - "last_imported_index": 0, | |
29 | - "name": "ListC", | |
30 | - "email": "listC@example.com" | |
31 | - }, | |
32 | - "model": "super_archives.mailinglist", | |
33 | - "pk": 3 | |
34 | -}, | |
35 | -{ | |
36 | - "fields": { | |
37 | - "spam": false, | |
38 | - "subject_token": "Thread_1_on_List_A", | |
39 | - "mailinglist": 1, | |
40 | - "score": 31, | |
41 | - "latest_message": 3 | |
42 | - }, | |
43 | - "model": "super_archives.thread", | |
44 | - "pk": 1 | |
45 | -}, | |
46 | -{ | |
47 | - "fields": { | |
48 | - "spam": false, | |
49 | - "subject_token": "Thread_1_on_List_B", | |
50 | - "mailinglist": 2, | |
51 | - "score": 0, | |
52 | - "latest_message": 4 | |
53 | - }, | |
54 | - "model": "super_archives.thread", | |
55 | - "pk": 3 | |
56 | -}, | |
57 | -{ | |
58 | - "fields": { | |
59 | - "spam": false, | |
60 | - "subject_token": "Thread_1_on_List_C", | |
61 | - "mailinglist": 3, | |
62 | - "score": 0, | |
63 | - "latest_message": 5 | |
64 | - }, | |
65 | - "model": "super_archives.thread", | |
66 | - "pk": 4 | |
67 | -}, | |
68 | -{ | |
69 | - "fields": { | |
70 | - "body": "This is a repply to Thread 1 on list A", | |
71 | - "received_time": "2015-01-28T12:43:00.752Z", | |
72 | - "from_address": 1, | |
73 | - "thread": 1, | |
74 | - "spam": false, | |
75 | - "subject_clean": "Response to Thread 1A", | |
76 | - "message_id": "loreipsum", | |
77 | - "subject": "Response to Thread 1A" | |
78 | - }, | |
79 | - "model": "super_archives.message", | |
80 | - "pk": 3 | |
81 | -}, | |
82 | -{ | |
83 | - "fields": { | |
84 | - "body": "This is a repply to Thread 1 on list B", | |
85 | - "received_time": "2015-01-28T12:57:22.180Z", | |
86 | - "from_address": 1, | |
87 | - "thread": 3, | |
88 | - "spam": false, | |
89 | - "subject_clean": "Message 1 on Thread 1B", | |
90 | - "message_id": "", | |
91 | - "subject": "Message 1 on Thread 1B" | |
92 | - }, | |
93 | - "model": "super_archives.message", | |
94 | - "pk": 4 | |
95 | -}, | |
96 | -{ | |
97 | - "fields": { | |
98 | - "body": "This is a repply to Thread 1 on list C", | |
99 | - "received_time": "2015-01-28T13:02:12.903Z", | |
100 | - "from_address": 1, | |
101 | - "thread": 4, | |
102 | - "spam": false, | |
103 | - "subject_clean": "Message 1 on Thread 1C", | |
104 | - "message_id": "", | |
105 | - "subject": "Message 1 on Thread 1C" | |
106 | - }, | |
107 | - "model": "super_archives.message", | |
108 | - "pk": 5 | |
109 | -}, | |
110 | -{ | |
111 | - "fields": { | |
112 | 4 | "last_name": "Administrator", |
113 | 5 | "webpage": "", |
114 | 6 | "twitter": "", |
... | ... | @@ -194,15 +86,5 @@ |
194 | 86 | }, |
195 | 87 | "model": "accounts.user", |
196 | 88 | "pk": 3 |
197 | -}, | |
198 | -{ | |
199 | - "fields": { | |
200 | - "real_name": "Administrator", | |
201 | - "user": 1, | |
202 | - "md5": "edb0e96701c209ab4b50211c856c50c4", | |
203 | - "address": "admin@mail.com" | |
204 | - }, | |
205 | - "model": "super_archives.emailaddress", | |
206 | - "pk": 1 | |
207 | 89 | } |
208 | 90 | ] | ... | ... |
colab/search/forms.py
... | ... | @@ -9,8 +9,6 @@ from haystack.forms import SearchForm |
9 | 9 | from haystack.inputs import AltParser |
10 | 10 | from haystack.inputs import AutoQuery |
11 | 11 | |
12 | -from colab.super_archives.models import MailingList | |
13 | - | |
14 | 12 | |
15 | 13 | class ColabSearchForm(SearchForm): |
16 | 14 | q = forms.CharField(label=_('Search'), required=False) |
... | ... | @@ -24,8 +22,7 @@ class ColabSearchForm(SearchForm): |
24 | 22 | list = forms.MultipleChoiceField( |
25 | 23 | required=False, |
26 | 24 | label=_(u'Mailinglist'), |
27 | - choices=[(v, v) for v in MailingList.objects.values_list( | |
28 | - 'name', flat=True)] | |
25 | + choices=[('TODO', 'TODO')] | |
29 | 26 | ) |
30 | 27 | milestone = forms.CharField(required=False, label=_(u'Milestone')) |
31 | 28 | priority = forms.CharField(required=False, label=_(u'Priority')) | ... | ... |
colab/settings.py
... | ... | @@ -53,7 +53,6 @@ INSTALLED_APPS = ( |
53 | 53 | 'colab', |
54 | 54 | 'colab.home', |
55 | 55 | 'colab.plugins', |
56 | - 'colab.super_archives', | |
57 | 56 | 'colab.rss', |
58 | 57 | 'colab.search', |
59 | 58 | 'colab.tz', |
... | ... | @@ -192,7 +191,6 @@ TEMPLATE_CONTEXT_PROCESSORS = ( |
192 | 191 | 'django.core.context_processors.tz', |
193 | 192 | 'django.contrib.messages.context_processors.messages', |
194 | 193 | 'django.core.context_processors.request', |
195 | - 'colab.super_archives.context_processors.mailarchive', | |
196 | 194 | 'colab.plugins.context_processors.colab_apps', |
197 | 195 | 'colab.home.context_processors.robots', |
198 | 196 | 'colab.home.context_processors.ribbon', |
... | ... | @@ -217,7 +215,6 @@ AUTHENTICATION_BACKENDS = ( |
217 | 215 | |
218 | 216 | LOCALE_PATHS = ( |
219 | 217 | os.path.join(BASE_DIR, 'locale'), |
220 | - os.path.join(BASE_DIR, 'super_archives/locale'), | |
221 | 218 | ) |
222 | 219 | |
223 | 220 | AUTH_USER_MODEL = 'accounts.User' |
... | ... | @@ -233,11 +230,6 @@ MESSAGE_TAGS = { |
233 | 230 | # Colab Settings |
234 | 231 | COLAB_HOME_URL = '/dashboard' |
235 | 232 | |
236 | -# Super Archives | |
237 | -SUPER_ARCHIVES_PATH = '/var/lib/mailman/archives/private' | |
238 | -SUPER_ARCHIVES_EXCLUDE = [] | |
239 | -SUPER_ARCHIVES_LOCK_FILE = '/var/lock/colab/import_emails.lock' | |
240 | - | |
241 | 233 | # Mailman API settings |
242 | 234 | MAILMAN_API_URL = 'http://localhost:8124/v2/' |
243 | 235 | ... | ... |
colab/urls.py