Merge pull request #11642 from AlanCoding/new_black_rule

Fix newly-added black rules
This commit is contained in:
Alan Rominger 2022-01-31 10:01:50 -05:00 committed by GitHub
commit 54b5884943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -862,7 +862,7 @@ class UnifiedJobSerializer(BaseSerializer):
if 'elapsed' in ret:
if obj and obj.pk and obj.started and not obj.finished:
td = now() - obj.started
ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / (10 ** 6 * 1.0)
ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / (10**6 * 1.0)
ret['elapsed'] = float(ret['elapsed'])
# Because this string is saved in the db in the source language,
# it must be marked for translation after it is pulled from the db, not when set

View File

@ -255,7 +255,7 @@ def random_ipv4():
def random_ipv6():
"""Generates a random ipv6 address;; useful for testing."""
return ':'.join('{0:x}'.format(random.randint(0, 2 ** 16 - 1)) for i in range(8))
return ':'.join('{0:x}'.format(random.randint(0, 2**16 - 1)) for i in range(8))
def random_loopback_ip():