mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-22 15:13:14 +00:00
Avoid unnecesary DB queries
This commit is contained in:
@ -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"])
|
||||
|
Reference in New Issue
Block a user