Skip to content

Commit

Permalink
Reduce number of database queries
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Oct 9, 2023
1 parent b8b7c08 commit 64a1153
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions safe_transaction_service/history/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ def save(self, **kwargs):
and (user := request.user)
):
trusted = user.has_perm("history.create_trusted")
try:

if self.validated_data["sender"] in self.validated_data["safe_owners"]:
proposer = self.validated_data["sender"]
else:
proposer = SafeContractDelegate.objects.get(
delegate=self.validated_data["sender"]
).delegator
except SafeContractDelegate.DoesNotExist:
proposer = self.validated_data["sender"]

multisig_transaction, created = MultisigTransaction.objects.get_or_create(
safe_tx_hash=safe_tx_hash,
Expand Down

0 comments on commit 64a1153

Please sign in to comment.