Skip to content

Commit

Permalink
fix some first ruff issues
Browse files Browse the repository at this point in the history
  • Loading branch information
etchegom committed Dec 12, 2023
1 parent d3ad1f1 commit 3b776b5
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 20 deletions.
1 change: 0 additions & 1 deletion apilos_settings/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
Expand Down
1 change: 0 additions & 1 deletion conventions/forms/convention_form_administration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django import forms
from django.core.validators import RegexValidator

from instructeurs.models import Administration

Expand Down
8 changes: 4 additions & 4 deletions conventions/management/commands/import_galion.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def handle(self, *args, **options):
+ f"l'entrée est ignorée: {str_row(my_row)}"
)
continue
if not my_row["Produit"] in dir(Financement):
if my_row["Produit"] not in dir(Financement):
if my_row["Produit"][0:4] in ["PLUS", "PLAI"]:
my_row["Produit"] = my_row["Produit"][0:4]
else:
Expand All @@ -129,7 +129,7 @@ def handle(self, *args, **options):
my_objects.append(my_row)
count_inserted += 1
if (
not my_row["Nb Garages aériens"] is None
my_row["Nb Garages aériens"] is not None
and int(my_row["Nb Garages aériens"]) > 0
):
ga_row = my_row.copy()
Expand All @@ -140,7 +140,7 @@ def handle(self, *args, **options):
ga_row["Loyer"] = my_row["Loyer Garages aériens"] # loyer
my_parkings.append(ga_row)
if (
not my_row["Nb Garages enterrés"] is None
my_row["Nb Garages enterrés"] is not None
and int(str(my_row["Nb Garages enterrés"])) > 0
):
ge_row = my_row.copy()
Expand All @@ -151,7 +151,7 @@ def handle(self, *args, **options):
ge_row["Loyer"] = my_row["Loyer Garages enterrés"] # loyer
my_parkings.append(ge_row)
if (
not my_row["Nb Places Stationnement"] is None
my_row["Nb Places Stationnement"] is not None
and int(str(my_row["Nb Places Stationnement"])) > 0
):
ps_row = my_row.copy()
Expand Down
2 changes: 1 addition & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_env_variable(name, cast=str, default=""):
]
return cast(os.environ[name])
# pylint: disable=W0702, bare-except
except:
except Exception:
return config(name, cast=cast, default=default)


Expand Down
1 change: 0 additions & 1 deletion ecoloweb/management/commands/ecoloweb_purge_import.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys
from typing import List

from django.conf import settings
from django.core.management import BaseCommand
Expand Down
4 changes: 2 additions & 2 deletions ecoloweb/tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from datetime import datetime
import glob
from pathlib import Path
from unittest import TestCase, skipIf
from unittest import TestCase

from django.db import connections, OperationalError
from django.db import connections
from django.db.backends.utils import CursorWrapper

from ecoloweb.services import ConventionImporter
Expand Down
3 changes: 0 additions & 3 deletions instructeurs/views.py

This file was deleted.

2 changes: 1 addition & 1 deletion siap/siap_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _call_siap_api(
try:
error_text = str(response.content["detail"])
# pylint: disable=W0702, bare-except
except:
except Exception:
pass
raise UnauthorizedSIAPException(error_text)
if response.status_code == 503:
Expand Down
3 changes: 0 additions & 3 deletions stats/admin.py

This file was deleted.

3 changes: 0 additions & 3 deletions stats/models.py

This file was deleted.

0 comments on commit 3b776b5

Please sign in to comment.