Commit 39a4bff81f0a3a770a5224847dbf06865f1360c5

Authored by Sergio Oliveira
1 parent 23d4e170

Fixed pep8 errors

Showing 1 changed file with 12 additions and 15 deletions   Show diff stats
colab/accounts/views.py
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # encoding: utf-8 2 # encoding: utf-8
3 3
4 -import datetime  
5 -  
6 from collections import OrderedDict 4 from collections import OrderedDict
7 5
8 from django.contrib import messages 6 from django.contrib import messages
@@ -14,19 +12,17 @@ from django.shortcuts import render, redirect, get_object_or_404 @@ -14,19 +12,17 @@ from django.shortcuts import render, redirect, get_object_or_404
14 from django.core.urlresolvers import reverse 12 from django.core.urlresolvers import reverse
15 from django.core.exceptions import PermissionDenied 13 from django.core.exceptions import PermissionDenied
16 from django.views.generic import DetailView, UpdateView, TemplateView 14 from django.views.generic import DetailView, UpdateView, TemplateView
17 -from django.utils.decorators import method_decorator  
18 15
19 -from django.http import HttpResponse  
20 from conversejs import xmpp 16 from conversejs import xmpp
21 from conversejs.models import XMPPAccount 17 from conversejs.models import XMPPAccount
22 from haystack.query import SearchQuerySet 18 from haystack.query import SearchQuerySet
23 19
24 from colab.super_archives.models import EmailAddress, Message 20 from colab.super_archives.models import EmailAddress, Message
25 from colab.search.utils import trans 21 from colab.search.utils import trans
26 -#from proxy.trac.models import WikiCollabCount, TicketCollabCount 22 +# from proxy.trac.models import WikiCollabCount, TicketCollabCount
27 from .forms import (UserCreationForm, ListsForm, UserUpdateForm, 23 from .forms import (UserCreationForm, ListsForm, UserUpdateForm,
28 ChangeXMPPPasswordForm) 24 ChangeXMPPPasswordForm)
29 -from .errors import XMPPChangePwdException 25 +# from .errors import XMPPChangePwdException
30 from .utils import mailman 26 from .utils import mailman
31 27
32 28
@@ -46,7 +42,8 @@ class UserProfileUpdateView(UserProfileBaseMixin, UpdateView): @@ -46,7 +42,8 @@ class UserProfileUpdateView(UserProfileBaseMixin, UpdateView):
46 form_class = UserUpdateForm 42 form_class = UserUpdateForm
47 43
48 def get_success_url(self): 44 def get_success_url(self):
49 - return reverse('user_profile', kwargs={'username': self.object.username}) 45 + return reverse('user_profile', kwargs={'username':
  46 + self.object.username})
50 47
51 def get_object(self, *args, **kwargs): 48 def get_object(self, *args, **kwargs):
52 obj = super(UserProfileUpdateView, self).get_object(*args, **kwargs) 49 obj = super(UserProfileUpdateView, self).get_object(*args, **kwargs)
@@ -71,13 +68,13 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): @@ -71,13 +68,13 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
71 ) 68 )
72 69
73 counter_class = {} 70 counter_class = {}
74 - #{  
75 - # 'wiki': WikiCollabCount,  
76 - # 'ticket': TicketCollabCount,  
77 - #} 71 + # {
  72 + # 'wiki': WikiCollabCount,
  73 + # 'ticket': TicketCollabCount,
  74 + # }
78 75
79 types = ['thread'] 76 types = ['thread']
80 - #types.extend(['ticket', 'wiki', 'changeset', 'attachment']) 77 + # types.extend(['ticket', 'wiki', 'changeset', 'attachment'])
81 78
82 messages = Message.objects.filter(from_address__user__pk=user.pk) 79 messages = Message.objects.filter(from_address__user__pk=user.pk)
83 for type in types: 80 for type in types:
@@ -111,9 +108,9 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): @@ -111,9 +108,9 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
111 context['emails'] = query[:10] 108 context['emails'] = query[:10]
112 109
113 count_by = 'thread__mailinglist__name' 110 count_by = 'thread__mailinglist__name'
114 - context['list_activity'] = dict(messages.values_list(count_by)\  
115 - .annotate(Count(count_by))\  
116 - .order_by(count_by)) 111 + context['list_activity'] = dict(messages.values_list(count_by)
  112 + .annotate(Count(count_by))
  113 + .order_by(count_by))
117 114
118 context.update(kwargs) 115 context.update(kwargs)
119 return super(UserProfileDetailView, self).get_context_data(**context) 116 return super(UserProfileDetailView, self).get_context_data(**context)