From 1193ab528acdee4125f3727e57ca6cb5ee50bdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Negr=C3=B3n?= Date: Thu, 26 Dec 2019 10:30:59 -0400 Subject: [PATCH] Flake8 --- Pipfile | 1 + Pipfile.lock | 38 +++++++++++++++++++++++++++++++++++++- notaso/restapi/views.py | 4 ++-- notaso/utils/apps.py | 1 - 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 61bb6ca..17170ff 100644 --- a/Pipfile +++ b/Pipfile @@ -36,6 +36,7 @@ boto3 = "==1.10.45" pre-commit = "*" black = "*" isort = "*" +flake8 = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index ad318c2..a7dea2f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "9f529c28d212432d255d685759ac48b820f946e798f057952636fbba8f74be61" + "sha256": "25a37e4c56a13b8f976b2102d2fda657c01973675c76cd69691dfd0b34c92a1b" }, "pipfile-spec": 6, "requires": { @@ -631,6 +631,21 @@ ], "version": "==7.0" }, + "entrypoints": { + "hashes": [ + "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", + "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" + ], + "version": "==0.3" + }, + "flake8": { + "hashes": [ + "sha256:45681a117ecc81e870cbf1262835ae4af5e7a8b08e40b944a8a6e6b895914cfb", + "sha256:49356e766643ad15072a789a20915d3c91dc89fd313ccd71802303fd67e4deca" + ], + "index": "pypi", + "version": "==3.7.9" + }, "identify": { "hashes": [ "sha256:6f44e637caa40d1b4cb37f6ed3b262ede74901d28b1cc5b1fc07360871edd65d", @@ -654,6 +669,13 @@ "index": "pypi", "version": "==4.3.21" }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, "more-itertools": { "hashes": [ "sha256:b84b238cce0d9adad5ed87e745778d20a3f8487d0f0cb8b8a586816c7496458d", @@ -681,6 +703,20 @@ "index": "pypi", "version": "==1.20.0" }, + "pycodestyle": { + "hashes": [ + "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", + "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + ], + "version": "==2.5.0" + }, + "pyflakes": { + "hashes": [ + "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", + "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" + ], + "version": "==2.1.1" + }, "pyyaml": { "hashes": [ "sha256:21a8e19e2007a4047ffabbd8f0ee32c0dabae3b7f4b6c645110ae53e7714b470", diff --git a/notaso/restapi/views.py b/notaso/restapi/views.py index a4c03a2..3267076 100644 --- a/notaso/restapi/views.py +++ b/notaso/restapi/views.py @@ -170,7 +170,7 @@ def list(self, request): if request.GET.get("university_id"): university_id = request.GET.get("university_id") for i, query in enumerate(self.queryset): - if query.count(university_id) is not 0: + if query.count(university_id) != 0: query.extra_info = { "university_id": university_id, "professors_count": query.count(university_id), @@ -206,7 +206,7 @@ def retrieve(self, request, pk=None): department = get_object_or_404(queryset, pk=pk) if request.GET.get("university_id"): university_id = request.GET.get("university_id") - if department.count(university_id) is not 0: + if department.count(university_id) != 0: department.extra_info = { "university": university_id, "professors_count": department.count(university_id), diff --git a/notaso/utils/apps.py b/notaso/utils/apps.py index e78fc70..14eaee0 100644 --- a/notaso/utils/apps.py +++ b/notaso/utils/apps.py @@ -1,5 +1,4 @@ from django.apps import AppConfig -from django.utils.translation import gettext_lazy as _ class UtilsConfig(AppConfig):