Commit 906e0626 authored by jitka's avatar jitka

Merge pull request #2 from matejcik/jitka-pylints

fix,pylints
parents 6b6cc1a4 78d9b229
......@@ -227,6 +227,7 @@ class UserSettingsForm(forms.ModelForm):
'hide_source_secondary',
)
class DashboardSettingsForm(forms.ModelForm):
'''
Dashboard settings form.
......@@ -246,7 +247,8 @@ class DashboardSettingsForm(forms.ModelForm):
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."))
_("Component list must be selected when used as default."))
class UserForm(forms.ModelForm):
'''
......
......@@ -24,8 +24,6 @@ import weblate
from weblate import appsettings
from weblate.trans.site import get_site_url
from weblate.trans.models.project import Project
from weblate.trans.models.translation import Translation
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'
......
......@@ -34,14 +34,14 @@ class ComponentList(models.Model):
max_length=100,
unique=True,
help_text=_('Name to display')
)
)
slug = models.SlugField(
verbose_name=_('URL slug'),
db_index=True, unique=True,
max_length=100,
help_text=_('Name used in URLs and file names.')
)
)
components = models.ManyToManyField('SubProject')
......
......@@ -611,7 +611,8 @@ def whiteboard_messages(project=None, subproject=None, language=None):
return mark_safe('\n'.join(ret))
@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))
return mark_safe('class="tab-pane %s" id="%s"' % (active, slug))
......@@ -71,8 +71,9 @@ def home(request):
wb_messages = WhiteboardMessage.objects.all()
projects = Project.objects.all_acl(request.user)
subproject_list = None
if projects.count() == 1:
projects = SubProject.objects.filter(
subproject_list = SubProject.objects.filter(
project=projects[0]
).select_related()
......@@ -127,12 +128,11 @@ def home(request):
'subproject__project__name', 'subproject__name'
).select_related()
return render(
request,
'index.html',
{
'projects': projects,
'projects': subproject_list or projects,
'top_translations': top_translations.select_related('user'),
'top_suggestions': top_suggestions.select_related('user'),
'last_changes': last_changes,
......
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