1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-03-22 10:34:49 +00:00

lint with black python. convert f style strings to old one.

This commit is contained in:
catborise 2020-11-04 13:31:08 +03:00
parent c20c353a40
commit c9a2c3d813
18 changed files with 956 additions and 754 deletions

View file

@ -35,11 +35,11 @@ def validate_ssh_key(key):
return False
# unpack the contents of data, from data[:4] , property of ssh key .
try:
str_len = struct.unpack('>I', data[:4])[0]
str_len = struct.unpack(">I", data[:4])[0]
except struct.error:
return False
# data[4:str_len] must have string which matches with the typeofkey, another ssh key property.
if data[4:4 + str_len] == typeofkey:
if data[4 : 4 + str_len] == typeofkey:
return True
else:
return False
@ -47,15 +47,15 @@ def validate_ssh_key(key):
def send_email_with_otp(user, device):
send_mail(
_('OTP QR Code'),
_('Please view HTML version of this message.'),
_("OTP QR Code"),
_("Please view HTML version of this message."),
None,
[user.email],
html_message=render_to_string(
'accounts/email/otp.html',
"accounts/email/otp.html",
{
'totp_url': device.config_url,
'user': user,
"totp_url": device.config_url,
"user": user,
},
),
fail_silently=False,