Skip to content

Commit

Permalink
fix(vote): remove positional argument to instance in admin form Register
Browse files Browse the repository at this point in the history
  • Loading branch information
igr-santos committed Sep 23, 2024
1 parent 332db33 commit 975f7ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/org_eleicoes/votepeloclima/candidature/forms/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,10 @@ class Meta(
)
}

def __init__(self, data=None, instance=None, *args, **kwargs):
def __init__(self, data=None, *args, **kwargs):
# Prepara os dados do formulário para conseguir passar pela validação
# no django admin
instance = kwargs.pop("instance", None)
new_data = instance.properties if instance else {}
if data:
ballot_name = data.get("ballot_name")
Expand Down

0 comments on commit 975f7ff

Please sign in to comment.