Skip to content

Sign petition with an account #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lpoujade
Copy link
Contributor

Proposition for #99 : auto fill petition's signature form with currently connected user, if any, else leave form empty

@lpoujade lpoujade changed the title 99 sign with account Sign petition with an account Sep 28, 2020
Copy link
Member

@fallen fallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

'email': pytitionuser.user.email
}

sign_form = SignatureForm(petition=petition, initial=initial)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!
Could you add one unit test for this new feature?
Just check that if a user is logged in, its personal information are displayed in the HTML form and that

form.is_bound == True

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep !

@fallen
Copy link
Member

fallen commented Oct 26, 2020

I can see you've rebased on origin/master.
Are you having troubles writing the unit test? I can write it if you want.
If you just lack time for this PR no worries then we can just wait :)

@lpoujade
Copy link
Contributor Author

yes i just don't had the time until this week, i finish that at the end of the week :)
sorry for the delay !

@fallen
Copy link
Member

fallen commented Oct 27, 2020

Absolutely no problem!
I just wanted to ping to see if there was an issue I could help with :)
No hurry and no worry!
Thanks for your help :)

@lpoujade lpoujade force-pushed the 99_sign_with_account branch from 510c8d5 to 5195f83 Compare February 9, 2025 12:13
@lpoujade
Copy link
Contributor Author

lpoujade commented Feb 9, 2025

So it's been a long week

I'm not sure if I should add a test in tests_PetitionViews.py as in my last commit or in tests_CreateSignatureView.py, could you give me a hint ? Maybe I should post the form before checking it ? Thank

@lpoujade lpoujade force-pushed the 99_sign_with_account branch from 54b886a to 6a183ed Compare February 9, 2025 12:56
@fallen
Copy link
Member

fallen commented Feb 11, 2025

Hey @lpoujade , long time no see! ;)
It's nice to see you getting back at playing with Pytition again!

I think that your change is mostly touching the Petition view (petition_detail.html template + slug_show_petition view)
so you are not creating a signature, so I think it's OK like this with testing in tests_PetitionViews.py

However I think you should also add your code inside the detail view.
Maybe this code should have a refactor to limit code duplication, but indeed there are -as of today- two entry points to petition_detail.html template:

Copy link
Member

@fallen fallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update detail view as well before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants