Commit e2ef073580fe5159955541bb34692c38e941d1d8

Authored by Sergio Oliveira
1 parent dbe18c1b

Fixed flake8 errors

colab/proxy/gitlab/admin.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.contrib import admin  
2 -  
3 -# Register your models here.  
colab/proxy/gitlab/models.py
1 from django.db import models 1 from django.db import models
2 -from django.conf import settings  
3 -from colab.accounts.models import User 2 +
4 3
5 class GitlabProject(models.Model): 4 class GitlabProject(models.Model):
6 5
colab/proxy/gitlab/tests.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
colab/proxy/jenkins/admin.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.contrib import admin  
2 -  
3 -# Register your models here.  
colab/proxy/jenkins/models.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.db import models  
2 -  
3 -# Create your models here.  
colab/proxy/jenkins/tests.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
colab/proxy/jenkins/views.py
1 1
2 -from django.conf import settings  
3 -  
4 from ..utils.views import ColabProxyView 2 from ..utils.views import ColabProxyView
5 3
6 4
colab/proxy/noosfero/admin.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.contrib import admin  
2 -  
3 -# Register your models here.  
colab/proxy/noosfero/models.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.db import models  
2 -  
3 -# Create your models here.  
colab/proxy/noosfero/tests.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
colab/proxy/redmine/admin.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.contrib import admin  
2 -  
3 -# Register your models here.  
colab/proxy/redmine/models.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.db import models  
2 -  
3 -# Create your models here.  
colab/proxy/redmine/tests.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
colab/proxy/redmine/views.py
1 1
2 -from django.conf import settings  
3 -  
4 from ..utils.views import ColabProxyView 2 from ..utils.views import ColabProxyView
5 3
6 4
colab/proxy/trac/admin.py
1 -from django.contrib import admin  
2 -  
3 -from . import signals 1 +from . import signals # noqa
colab/proxy/trac/routers.py
@@ -11,7 +11,7 @@ class TracRouter(object): @@ -11,7 +11,7 @@ class TracRouter(object):
11 11
12 def allow_relation(self, obj1, obj2, **hints): 12 def allow_relation(self, obj1, obj2, **hints):
13 if obj1._meta.app_label == 'proxy' or \ 13 if obj1._meta.app_label == 'proxy' or \
14 - obj2._meta.app_label == 'proxy': 14 + obj2._meta.app_label == 'proxy':
15 return True 15 return True
16 return None 16 return None
17 17
colab/proxy/trac/search_indexes.py
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 -import math  
4 import string 3 import string
5 4
6 from django.template import loader, Context 5 from django.template import loader, Context
7 -from django.utils.text import slugify  
8 from haystack import indexes 6 from haystack import indexes
9 from haystack.utils import log as logging 7 from haystack.utils import log as logging
10 8
@@ -15,7 +13,7 @@ from .models import Attachment, Ticket, Wiki, Revision @@ -15,7 +13,7 @@ from .models import Attachment, Ticket, Wiki, Revision
15 logger = logging.getLogger('haystack') 13 logger = logging.getLogger('haystack')
16 14
17 # the string maketrans always return a string encoded with latin1 15 # the string maketrans always return a string encoded with latin1
18 -# http://stackoverflow.com/questions/1324067/how-do-i-get-str-translate-to-work-with-unicode-strings 16 +# http://stackoverflow.com/questions/1324067/how-do-i-get-str-translate-to-work-with-unicode-strings # noqa
19 table = string.maketrans( 17 table = string.maketrans(
20 string.punctuation, 18 string.punctuation,
21 '.' * len(string.punctuation) 19 '.' * len(string.punctuation)
colab/proxy/trac/signals.py
@@ -12,22 +12,22 @@ def change_session_attribute_email(sender, instance, **kwargs): @@ -12,22 +12,22 @@ def change_session_attribute_email(sender, instance, **kwargs):
12 12
13 cursor.execute(("UPDATE session_attribute SET value=%s " 13 cursor.execute(("UPDATE session_attribute SET value=%s "
14 "WHERE name='email' AND sid=%s"), 14 "WHERE name='email' AND sid=%s"),
15 - [instance.email, instance.username]) 15 + [instance.email, instance.username])
16 cursor.execute(("UPDATE session_attribute SET value=%s " 16 cursor.execute(("UPDATE session_attribute SET value=%s "
17 "WHERE name='name' AND sid=%s"), 17 "WHERE name='name' AND sid=%s"),
18 - [instance.get_full_name(), instance.username]) 18 + [instance.get_full_name(), instance.username])
19 19
20 cursor.execute(("INSERT INTO session_attribute " 20 cursor.execute(("INSERT INTO session_attribute "
21 "(sid, authenticated, name, value) " 21 "(sid, authenticated, name, value) "
22 "SELECT %s, '1', 'email', %s WHERE NOT EXISTS " 22 "SELECT %s, '1', 'email', %s WHERE NOT EXISTS "
23 "(SELECT 1 FROM session_attribute WHERE sid=%s " 23 "(SELECT 1 FROM session_attribute WHERE sid=%s "
24 "AND name='email')"), 24 "AND name='email')"),
25 - [instance.username, instance.email, instance.username]) 25 + [instance.username, instance.email, instance.username])
26 26
27 cursor.execute(("INSERT INTO session_attribute " 27 cursor.execute(("INSERT INTO session_attribute "
28 "(sid, authenticated, name, value) " 28 "(sid, authenticated, name, value) "
29 "SELECT %s, '1', 'name', %s WHERE NOT EXISTS " 29 "SELECT %s, '1', 'name', %s WHERE NOT EXISTS "
30 "(SELECT 1 FROM session_attribute WHERE sid=%s " 30 "(SELECT 1 FROM session_attribute WHERE sid=%s "
31 "AND name='name')"), 31 "AND name='name')"),
32 - [instance.username, instance.get_full_name(),  
33 - instance.username]) 32 + [instance.username, instance.get_full_name(),
  33 + instance.username])
colab/proxy/trac/tests.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
colab/proxy/trac/views.py
1 1
2 -from django.conf import settings  
3 -  
4 from hitcounter.views import HitCounterViewMixin 2 from hitcounter.views import HitCounterViewMixin
5 3
6 from ..utils.views import ColabProxyView 4 from ..utils.views import ColabProxyView