Merge pull request #2078 from RoboSats/keep-nostr-updated

Avoid unnecesary DB queries
This commit is contained in:
KoalaSat
2025-07-13 10:31:43 +00:00
committed by GitHub

View File

@ -95,6 +95,8 @@ class RobotTokenSHA256AuthenticationMiddleWare:
nostr_pubkey = request.META.get("NOSTR_PUBKEY", "").replace(
"Nostr ", ""
)
if token.user.robot.nostr_pubkey != nostr_pubkey:
token.user.robot.nostr_pubkey = nostr_pubkey
token.user.robot.save(update_fields=["nostr_pubkey"])