Commit 89fb9370 authored by Jitka Novotna's avatar Jitka Novotna

pylint

parent 4388591c
......@@ -242,7 +242,8 @@ class DashboardSettingsForm(forms.ModelForm):
'''
Check if component list is selected when required.
'''
if self.cleaned_data['dashboard_view']==Profile.DASHBOARD_COMPONENT_LIST and \
if self.cleaned_data['dashboard_view'] == \
Profile.DASHBOARD_COMPONENT_LIST and \
self.cleaned_data['dashboard_component_list'] is None:
raise forms.ValidationError(
_("Componest list must be selected when used as default."))
......
......@@ -507,7 +507,7 @@ class Profile(models.Model):
(DASHBOARD_COMPONENT_LIST, _('Component list')),
)
dashboard_view = models.CharField(
max_length = 100,
max_length=100,
choices=DASHBOARD_CHOICES,
verbose_name=_('Default dashboard view'),
default=DASHBOARD_SUBSCRIPTIONS,
......
......@@ -26,7 +26,7 @@ from weblate.trans.site import get_site_url
from weblate.trans.models.componentlist import ComponentList
from weblate.trans.models.project import Project
from weblate.trans.models.translation import Translation
from weblate.accounts.models import Profile
from weblate.accounts.models import Profile
URL_BASE = 'https://weblate.org/?utm_source=weblate&utm_term=%s'
URL_DONATE = 'https://weblate.org/donate/?utm_source=weblate&utm_term=%s'
......@@ -50,14 +50,14 @@ def weblate_context(request):
subscribed_projects = None
usersubscriptions = None
userlanguages = None
active_tab_slug = Profile.DASHBOARD_ALL
active_tab_slug = Profile.DASHBOARD_ALL
if request.user.is_authenticated():
active_tab_slug = request.user.profile.dashboard_view
if active_tab_slug == Profile.DASHBOARD_COMPONENT_LIST:
clist = request.user.profile.dashboard_component_list
active_tab_slug = clist.tab_slug()
dashboard_choices[active_tab_slug] = clist.name
dashboard_choices[active_tab_slug] = clist.name
subscribed_projects = request.user.profile.subscriptions.all()
......@@ -77,11 +77,11 @@ def weblate_context(request):
for componentlist in componentlists:
componentlist.translations = Translation.objects.filter(
language__in=request.user.profile.languages.all(),
subproject__in=componentlist.components.all()
).order_by(
'subproject__project__name', 'subproject__name'
).select_related()
language__in=request.user.profile.languages.all(),
subproject__in=componentlist.components.all()
).order_by(
'subproject__project__name', 'subproject__name'
).select_related()
return {
......
......@@ -30,11 +30,11 @@ import csv
import traceback
import importlib
from django.utils.translation import ugettext_lazy as _
import six
from six import StringIO
from django.utils.translation import ugettext_lazy as _
from translate.convert import po2php
from translate.storage.lisa import LISAfile
from translate.storage.properties import propunit, propfile
......
......@@ -18,14 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import six.moves
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Count, Q
from django.utils.encoding import python_2_unicode_compatible
from django.utils.encoding import python_2_unicode_compatible, force_text
from django.utils.translation import ugettext as _, ugettext_lazy
from django.utils import timezone
from django.utils.encoding import force_text
import six.moves
from weblate.trans.models.project import Project
from weblate.accounts.avatar import get_user_display
......
......@@ -613,5 +613,5 @@ def whiteboard_messages(project=None, subproject=None, language=None):
@register.simple_tag(takes_context=True)
def active_tab(context, slug):
active = "active" if slug==context['active_tab_slug'] else ""
return mark_safe('class="tab-pane %s" id="%s"' %(active,slug))
active = "active" if slug == context['active_tab_slug'] else ""
return mark_safe('class="tab-pane %s" id="%s"' %(active, slug))
......@@ -27,14 +27,14 @@ from xml.dom import minidom
from six.moves.urllib.parse import urlsplit
from six import StringIO
from PIL import Image
from django.test.client import RequestFactory
from django.contrib.auth.models import Group, User
from django.core.urlresolvers import reverse
from django.contrib.messages.storage.fallback import FallbackStorage
from django.core import mail
from PIL import Image
from weblate.trans.models import WhiteboardMessage
from weblate.trans.tests.test_models import RepoTestCase
from weblate.accounts.models import Profile
......
......@@ -20,14 +20,14 @@
import os.path
from django.utils.translation import ugettext as _
from django.template.loader import render_to_string
from PIL import Image, ImageDraw
from six import StringIO
from six.moves.urllib.parse import quote
from django.utils.translation import ugettext as _
from django.template.loader import render_to_string
from weblate.trans.fonts import is_base, get_font
from weblate.appsettings import ENABLE_HTTPS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment