ドメインページを最適化する

This commit is contained in:
Mouriya
2024-08-08 15:30:09 +09:00
parent ad96c923b2
commit 914b0d85df
3 changed files with 109 additions and 62 deletions

View File

@@ -35,6 +35,8 @@ def create_access_token(*, data: dict, expires_delta: timedelta = None):
return encoded_jwt
def chacha20Encrypt(plaintext:str, key=config.KINTONE_PSW_CRYPTO_KEY):
if plaintext is None or plaintext == '':
return None
nonce = os.urandom(16)
algorithm = algorithms.ChaCha20(key, nonce)
cipher = Cipher(algorithm, mode=None)

View File

@@ -216,9 +216,9 @@ def edit_domain(
update_data = domain.dict(exclude_unset=True)
for key, value in update_data.items():
if(key != "id"):
setattr(db_domain, key, value)
if key != "id" and not (key == "kintonepwd" and (value is None or value == "")):
setattr(db_domain, key, value)
print(str(db_domain))
db.add(db_domain)
db.commit()
db.refresh(db_domain)