Skip to content

Commit e6f68d2

Browse files
committed
fix flake8
1 parent d360baa commit e6f68d2

File tree

6 files changed

+3
-5
lines changed

6 files changed

+3
-5
lines changed

django_api_forms/fields.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def to_python(self, value) -> typing.Optional[File]:
288288
image.verify()
289289
f.image = Image.open(file) # Image have to be reopened after Image.verify() call
290290
f.content_type = Image.MIME.get(image.format)
291-
except Exception as e:
291+
except Exception:
292292
raise ValidationError(
293293
self.error_messages['invalid_image'],
294294
code='invalid_image'

tests/test_fields.py

-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ def test_non_value(self):
556556
with self.assertRaisesMessage(ValidationError, expected_error):
557557
file_field.clean(None)
558558

559-
560559
def test_mime(self):
561560
file_field = FileField(mime=('image/jpeg',))
562561
django_file = file_field.clean(self._payload)

tests/test_population.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django_api_forms import Form, EnumField, FormField
66
from django_api_forms.exceptions import ApiFormException
77
from tests import settings
8-
from tests.testapp.forms import AlbumForm, BandForm, ArtistForm, ConcertForm
8+
from tests.testapp.forms import AlbumForm, BandForm, ArtistForm
99
from tests.testapp.models import Album, Artist, Band
1010

1111

tests/test_validation.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import datetime
22

33
from django.conf import settings
4-
from django.forms import ValidationError
54
from django.test import RequestFactory, TestCase
65

76
from tests.testapp.forms import AlbumForm

tests/testapp/forms.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Meta:
1818
genres = FieldList(field=fields.CharField(max_length=30))
1919
members = fields.IntegerField()
2020

21+
2122
class SongForm(Form):
2223
title = fields.CharField(required=True, max_length=100)
2324
duration = fields.DurationField(required=True)

tests/testapp/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class Meta:
1212
has_own_label = models.BooleanField(default=False)
1313

1414

15-
1615
class Album(models.Model):
1716
class Meta:
1817
db_table = 'albums'

0 commit comments

Comments
 (0)