Merge pull request #5368 from jsangmeister/fix-flake

Fixed formatting after flake update
This commit is contained in:
Emanuel Schütze 2020-05-14 07:31:15 +02:00 committed by GitHub
commit b7b27d2e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View File

@ -822,7 +822,7 @@ class UserLoginView(WhoAmIDataView):
user = User.objects.get(username="admin") user = User.objects.get(username="admin")
if user.check_password("admin"): if user.check_password("admin"):
context["login_info_text"] = ( context["login_info_text"] = (
f"Use <strong>admin</strong> and <strong>admin</strong> for your first login.<br>" "Use <strong>admin</strong> and <strong>admin</strong> for your first login.<br>"
"Please change your password to hide this message!" "Please change your password to hide this message!"
) )
except User.DoesNotExist: except User.DoesNotExist:

View File

@ -52,7 +52,7 @@ class WebsocketLatencyLogger:
""" Calc Stats and print to logger. """ """ Calc Stats and print to logger. """
N = len(self.latencies) N = len(self.latencies)
mean = sum(self.latencies) / N mean = sum(self.latencies) / N
std = sum((l - mean) ** 2 for l in self.latencies) std = sum((latency - mean) ** 2 for latency in self.latencies)
self.logger.debug(f"N={N}, mean={mean:.2f}, std={std:.2f}") self.logger.debug(f"N={N}, mean={mean:.2f}, std={std:.2f}")
self.reset() self.reset()

View File

@ -86,8 +86,7 @@ class Command(BaseCommand):
parser.add_argument( parser.add_argument(
"--only", "--only",
action="store_true", action="store_true",
help="Only the given objects are created i. e. all defaults are " help="Only the given objects are created i. e. all defaults are set to 0.",
"set to 0.",
) )
parser.add_argument( parser.add_argument(
"-t", "-t",
@ -112,9 +111,13 @@ class Command(BaseCommand):
"--users", "--users",
nargs=2, nargs=2,
type=int, type=int,
help=f"Number of users to be created. The first number of users is " help=dedent(
'added to the group "Staff" (default {DEFAULT_NUMBER}). The second number ' f"""
"of users is not added to any group (default {DEFAULT_NUMBER}).", Number of users to be created. The first number of users is added \
to the group "Staff" (default {DEFAULT_NUMBER}). The second number \
of users is not added to any group (default {DEFAULT_NUMBER}).
"""
),
) )
def handle(self, *args, **options): def handle(self, *args, **options):

View File

@ -66,7 +66,7 @@ def test_list_of_speakers_db_queries():
Motion.objects.create(title="motion2") Motion.objects.create(title="motion2")
Assignment.objects.create(title="assignment", open_posts=5) Assignment.objects.create(title="assignment", open_posts=5)
Mediafile.objects.create( Mediafile.objects.create(
title=f"mediafile", mediafile=SimpleUploadedFile(f"some_file", b"some content.") title="mediafile", mediafile=SimpleUploadedFile("some_file", b"some content.")
) )
assert count_queries(ListOfSpeakers.get_elements)() == 6 assert count_queries(ListOfSpeakers.get_elements)() == 6