Skip to content

Commit

Permalink
Assign signature owner to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
falvaradorodriguez committed Oct 30, 2024
1 parent d635eac commit 3b80d15
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 @@ -570,20 +570,21 @@ def validate(self, attrs):
):
raise ValidationError("Only EOA and ETH_SIGN signatures are supported")

owner = safe_signature.owner
# The transaction can be deleted by the proposer or by the delegate user who proposed it.
if safe_signature.owner == proposer:
if owner == proposer:
return attrs
if (
multisig_tx.proposed_by_delegate
and safe_signature.owner == multisig_tx.proposed_by_delegate
and owner == multisig_tx.proposed_by_delegate
):
delegates_for_proposer = (
SafeContractDelegate.objects.get_delegates_for_safe_and_owners(
safe_address, [proposer]
)
)
# Check if it's still a valid delegate.
if safe_signature.owner in delegates_for_proposer:
if owner in delegates_for_proposer:
return attrs

raise ValidationError(
Expand Down

0 comments on commit 3b80d15

Please sign in to comment.