Skip to content

Commit 1bf5319

Browse files
committed
Fill signature form if connected
1 parent 198d80d commit 1bf5319

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pytition/petition/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,14 @@ def slug_show_petition(request, orgslugname=None, username=None, petitionname=No
15301530
except SlugModel.DoesNotExist:
15311531
raise Http404(_("Sorry, we are not able to find this petition"))
15321532
petition = slug.petition
1533-
sign_form = SignatureForm(petition=petition)
1533+
1534+
initial = None if not pytitionuser else {
1535+
'first_name': pytitionuser.user.first_name,
1536+
'last_name': pytitionuser.user.last_name,
1537+
'email': pytitionuser.user.email
1538+
}
1539+
1540+
sign_form = SignatureForm(petition=petition, initial=initial)
15341541

15351542
ctx = {"user": pytitionuser, "petition": petition, "form": sign_form,
15361543
'meta': petition_detail_meta(request, petition.id)}

0 commit comments

Comments
 (0)