From 24549c40d7d7633bf35b50eea312bd99148df3c5 Mon Sep 17 00:00:00 2001 From: borzechof99 <borzechof99@mi.fu-berlin.de> Date: Thu, 1 Jul 2021 16:41:38 +0200 Subject: [PATCH] Fix Linter --- .pylintrc | 1 + .../quiz/management/commands/seed_db.py | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.pylintrc b/.pylintrc index 7b3eea2..09b688c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,4 +10,5 @@ disable=line-too-long, arguments-differ, invalid-name, no-else-raise, + arguments-renamed, diff --git a/unisportomat/quiz/management/commands/seed_db.py b/unisportomat/quiz/management/commands/seed_db.py index c1d32d1..36270c9 100644 --- a/unisportomat/quiz/management/commands/seed_db.py +++ b/unisportomat/quiz/management/commands/seed_db.py @@ -133,11 +133,12 @@ class Command(BaseCommand): ), ("Mache vor der nächsten Frage 3 Jumping Jacks", "Do Three Jumping Jacks."), ] - image = SimpleUploadedFile( - name="test_image.png", - content=open("quiz/fixtures/images/test_image.png", "rb").read(), - content_type="image/png", - ) + with open("quiz/fixtures/images/test_image.png", "rb") as read_file: + image = SimpleUploadedFile( + name="test_image.png", + content=read_file.read(), + content_type="image/png", + ) for text in calls_to_move: activate("de") @@ -161,11 +162,13 @@ class Command(BaseCommand): "That proper training prevents heart disease?", ), ] - image = SimpleUploadedFile( - name="logo.png", - content=open("quiz/fixtures/images/logo.png", "rb").read(), - content_type="image/png", - ) + + with open("quiz/fixtures/images/logo.png", "rb") as read_file: + image = SimpleUploadedFile( + name="logo.png", + content=read_file.read(), + content_type="image/png", + ) for text in knowledge_snacks: activate("de") k_s = KnowledgeSnack(text=text[0], image=image) -- GitLab