[damned-lies] chore: flake8 fixes on api
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] chore: flake8 fixes on api
- Date: Fri, 7 May 2021 12:21:44 +0000 (UTC)
commit 488bc7be0c3a8395187985b4f5c75627fd5c2f00
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date: Fri Apr 30 11:29:15 2021 +0200
chore: flake8 fixes on api
api/tests.py | 4 ++--
api/urls.py | 16 ++++++++++------
api/views.py | 2 +-
3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/api/tests.py b/api/tests.py
index fcd274d6..06658812 100644
--- a/api/tests.py
+++ b/api/tests.py
@@ -36,10 +36,10 @@ class APITests(TestCase):
self.assertEqual(result['vcs_web'], 'https://gitlab.gnome.org/GNOME/gnome-hello/')
self.assertEqual(result['branches'], [{'name': 'master'}])
self.assertEqual(
- result['domains'][1],
+ result['domains'][1],
{'description': 'UI Translations', 'name': 'po', 'dtype': 'ui', 'layout': 'po/{lang}.po'}
)
-
+
def test_teams(self):
response = self.client.get(reverse('api-teams'))
result = response.json()
diff --git a/api/urls.py b/api/urls.py
index 93ea78bf..b5190d96 100644
--- a/api/urls.py
+++ b/api/urls.py
@@ -17,10 +17,12 @@ urlpatterns = [
path('releases/', views.ReleasesView.as_view(), name='api-releases'),
path('releases/<name:release>', views.ReleaseView.as_view(), name='api-release'),
path('releases/<name:release>/stats', views.ReleaseStatsView.as_view(), name='api-release-stats'),
- path('releases/<name:release>/languages/<locale:lang>', views.ReleaseLanguageView.as_view(),
- name='api-release-language'),
- path(complete_translatable_path, views.ModuleLangStatsView.as_view(),
- name='api-module-lang-stats'
+ path(
+ 'releases/<name:release>/languages/<locale:lang>', views.ReleaseLanguageView.as_view(),
+ name='api-release-language'
+ ),
+ path(
+ complete_translatable_path, views.ModuleLangStatsView.as_view(), name='api-module-lang-stats'
),
# APIs to reserve translation and upload translation, as could be used by an external
# translation tool.
@@ -28,6 +30,8 @@ urlpatterns = [
path(f'{complete_translatable_path}/upload', views.UploadTranslationView.as_view(), name='api-upload'),
# Used by a GitLab webhook to signal a commit for that module/branch
- path('modules/<name:module_name>/branches/<path:branch_name>/ping', views.rebuild_branch,
- name='api-module-rebuild'),
+ path(
+ 'modules/<name:module_name>/branches/<path:branch_name>/ping', views.rebuild_branch,
+ name='api-module-rebuild'
+ ),
]
diff --git a/api/views.py b/api/views.py
index 5ebec3da..e8f1df0a 100644
--- a/api/views.py
+++ b/api/views.py
@@ -256,7 +256,7 @@ def rebuild_branch(request, module_name, branch_name):
def rebuild_branch_real(branch):
try:
branch.update_stats(force=False)
- except Exception as exc:
+ except Exception:
tbtext = traceback.format_exc()
mail_admins("Error while updating %s %s" % (branch.module.name, branch.name), tbtext)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]