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 1 #!/usr/bin/env python
2 2 # encoding: utf-8
3 3  
4   -import datetime
5   -
6 4 from collections import OrderedDict
7 5  
8 6 from django.contrib import messages
... ... @@ -14,19 +12,17 @@ from django.shortcuts import render, redirect, get_object_or_404
14 12 from django.core.urlresolvers import reverse
15 13 from django.core.exceptions import PermissionDenied
16 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 16 from conversejs import xmpp
21 17 from conversejs.models import XMPPAccount
22 18 from haystack.query import SearchQuerySet
23 19  
24 20 from colab.super_archives.models import EmailAddress, Message
25 21 from colab.search.utils import trans
26   -#from proxy.trac.models import WikiCollabCount, TicketCollabCount
  22 +# from proxy.trac.models import WikiCollabCount, TicketCollabCount
27 23 from .forms import (UserCreationForm, ListsForm, UserUpdateForm,
28 24 ChangeXMPPPasswordForm)
29   -from .errors import XMPPChangePwdException
  25 +# from .errors import XMPPChangePwdException
30 26 from .utils import mailman
31 27  
32 28  
... ... @@ -46,7 +42,8 @@ class UserProfileUpdateView(UserProfileBaseMixin, UpdateView):
46 42 form_class = UserUpdateForm
47 43  
48 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 48 def get_object(self, *args, **kwargs):
52 49 obj = super(UserProfileUpdateView, self).get_object(*args, **kwargs)
... ... @@ -71,13 +68,13 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
71 68 )
72 69  
73 70 counter_class = {}
74   - #{
75   - # 'wiki': WikiCollabCount,
76   - # 'ticket': TicketCollabCount,
77   - #}
  71 + # {
  72 + # 'wiki': WikiCollabCount,
  73 + # 'ticket': TicketCollabCount,
  74 + # }
78 75  
79 76 types = ['thread']
80   - #types.extend(['ticket', 'wiki', 'changeset', 'attachment'])
  77 + # types.extend(['ticket', 'wiki', 'changeset', 'attachment'])
81 78  
82 79 messages = Message.objects.filter(from_address__user__pk=user.pk)
83 80 for type in types:
... ... @@ -111,9 +108,9 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
111 108 context['emails'] = query[:10]
112 109  
113 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 115 context.update(kwargs)
119 116 return super(UserProfileDetailView, self).get_context_data(**context)
... ...