Skip to content

Commit 7eae556

Browse files
committed
Merge branch 'dev' into version-3-0-alpha
2 parents 5cd25a1 + 24ab0a3 commit 7eae556

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tom_common/session_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ def reencrypt_data(user) -> None:
260260

261261
# Get the new raw password from the User instance
262262
new_raw_password = user._password # CAUTION: this is implemenation dependent (using _<property>)
263+
if not new_raw_password:
264+
logger.error(f"User {user.username} does not have a raw password available. Cannot re-encrypt sensitive data.")
265+
return
263266
# Generate a new encryption_key with the new raw password
264267
new_encryption_key: bytes = create_cipher_encryption_key(user, new_raw_password)
265268
# Generate a new encoding Fernet cipher with the new encryption key

0 commit comments

Comments
 (0)