lint(onion): remove dunder calls

This commit is contained in:
Iain Learmonth 2023-01-21 14:10:40 +00:00
parent 70bdebd155
commit bdee43b78c

View file

@ -100,8 +100,9 @@ def onion_edit(onion_id: int) -> ResponseReturnValue:
"tls_private_key", "tls_private_key",
"tls_public_key" "tls_public_key"
]: ]:
if form.__getattribute__(at).data is not None: if getattr(form, at).data is not None:
onion.__setattr__(at, form.__getattribute__(at).data.read()) # Don't clear the key if no key is uploaded
setattr(onion, at, getattr(form, at).data.read())
onion.updated = datetime.utcnow() onion.updated = datetime.utcnow()
try: try:
db.session.commit() db.session.commit()