Lint changes
parent
91a205e5ab
commit
9f11db5347
|
@ -37,11 +37,7 @@ class Command(BaseCommand):
|
|||
print('Invalid GitHub token, exiting')
|
||||
return
|
||||
|
||||
for project in Project.objects.filter(
|
||||
programming_language__in=[
|
||||
'none', '', 'words',
|
||||
],
|
||||
).filter(repo__contains='github',):
|
||||
for project in Project.objects.filter(programming_language__in=['none', '', 'words']).filter(repo__contains='github'):
|
||||
user = repo = ''
|
||||
repo_url = project.repo
|
||||
for regex in GITHUB_REGEXS:
|
||||
|
|
|
@ -58,9 +58,9 @@ def map_subproject_slug(view_func):
|
|||
"""
|
||||
|
||||
@wraps(view_func)
|
||||
def inner_view(
|
||||
request, subproject=None, subproject_slug=None, *args, **kwargs
|
||||
): # noqa
|
||||
def inner_view( # noqa
|
||||
request, subproject=None, subproject_slug=None, *args, **kwargs,
|
||||
):
|
||||
if subproject is None and subproject_slug:
|
||||
# Try to fetch by subproject alias first, otherwise we might end up
|
||||
# redirected to an unrelated project.
|
||||
|
@ -88,9 +88,9 @@ def map_project_slug(view_func):
|
|||
"""
|
||||
|
||||
@wraps(view_func)
|
||||
def inner_view(
|
||||
def inner_view( # noqa
|
||||
request, project=None, project_slug=None, *args, **kwargs
|
||||
): # noqa
|
||||
):
|
||||
if project is None:
|
||||
if not project_slug:
|
||||
project_slug = request.slug
|
||||
|
|
|
@ -616,9 +616,14 @@ class TranslationBaseForm(forms.Form):
|
|||
raise forms.ValidationError(
|
||||
_(msg).format(lang=self.parent.get_language_display()),
|
||||
)
|
||||
|
||||
# yapf: disable
|
||||
exists_translation = (
|
||||
self.parent.translations.filter(language=self.translation.language).exists() # yapf: disabled
|
||||
self.parent.translations
|
||||
.filter(language=self.translation.language)
|
||||
.exists()
|
||||
)
|
||||
# yapf: enable
|
||||
if exists_translation:
|
||||
msg = ('This project already has a translation for {lang}.')
|
||||
raise forms.ValidationError(
|
||||
|
|
|
@ -1046,7 +1046,7 @@ class APIProject(Project):
|
|||
'absolute_url',
|
||||
'downloads',
|
||||
'main_language_project',
|
||||
'related_projects',]:
|
||||
'related_projects']:
|
||||
try:
|
||||
del kwargs[key]
|
||||
except KeyError:
|
||||
|
|
|
@ -30,7 +30,7 @@ def process_all_json_files(version, build_dir=True):
|
|||
if filename in [
|
||||
'search.fjson',
|
||||
'genindex.fjson',
|
||||
'py-modindex.fjson',]:
|
||||
'py-modindex.fjson']:
|
||||
continue
|
||||
html_files.append(os.path.join(root, filename))
|
||||
page_list = []
|
||||
|
|
Loading…
Reference in New Issue