mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-22 02:33:17 +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_pubkey = request.META.get("NOSTR_PUBKEY", "").replace(
|
||||||
"Nostr ", ""
|
"Nostr ", ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if token.user.robot.nostr_pubkey != nostr_pubkey:
|
||||||
token.user.robot.nostr_pubkey = nostr_pubkey
|
token.user.robot.nostr_pubkey = nostr_pubkey
|
||||||
|
|
||||||
token.user.robot.save(update_fields=["nostr_pubkey"])
|
token.user.robot.save(update_fields=["nostr_pubkey"])
|
||||||
|
Reference in New Issue
Block a user