Compare commits

..

1 Commits

Author SHA1 Message Date
Aiirondev_dev 1331afa4da Fix of hexdigest 2026-07-29 13:40:17 +02:00
+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 # Create unique hash of subscription using plaintext data to avoid duplicates
sub_hash = hashlib.shake_256( sub_hash = hashlib.shake_256(
f"{username}:{endpoint}".encode('utf-8') f"{username}:{endpoint}".encode('utf-8')
).hexdigest() ).hexdigest(32)
# Check if subscription already exists by Hash # Check if subscription already exists by Hash
existing = subs_col.find_one({ existing = subs_col.find_one({
@@ -197,7 +197,7 @@ def remove_push_subscription(username, endpoint):
sub_hash = hashlib.shake_256( sub_hash = hashlib.shake_256(
f"{username}:{endpoint}".encode('utf-8') f"{username}:{endpoint}".encode('utf-8')
).hexdigest() ).hexdigest(32)
result = subs_col.update_one( result = subs_col.update_one(
{'SubscriptionHash': sub_hash}, {'SubscriptionHash': sub_hash},