Fix of hexdigest

This commit is contained in:
2026-07-29 13:40:17 +02:00
parent 5a2d703bc7
commit 1331afa4da
+2 -2
View File
@@ -142,7 +142,7 @@ def save_push_subscription(username, subscription_obj):
# Create unique hash of subscription using plaintext data to avoid duplicates
sub_hash = hashlib.shake_256(
f"{username}:{endpoint}".encode('utf-8')
).hexdigest()
).hexdigest(32)
# Check if subscription already exists by Hash
existing = subs_col.find_one({
@@ -197,7 +197,7 @@ def remove_push_subscription(username, endpoint):
sub_hash = hashlib.shake_256(
f"{username}:{endpoint}".encode('utf-8')
).hexdigest()
).hexdigest(32)
result = subs_col.update_one(
{'SubscriptionHash': sub_hash},