Closed leian7 closed 7 years ago
@leian7 did you see my update to #77 related to this PR?
@ramereth I did, I discussed it with @Kennric , and my understanding is that the list provided to fields_to_join
can be completely arbitrary; the form author gets to decide their specific string and its order. For extra bits like ibm-power
they can have it be a hidden field. Is this correct? Or did you want $username:$user_first:$user_last:$phone:$company:$date:$email:ibm-power:support
to always be included in the string?
How will the date field work since it's not a field in the form?
@leian7 @ramereth for the date, we'll need to calculate that - my thought was that we'd do it in the form, but on second thought I'd rather not add javascript for that. Let's have formsender check the fields_to_join list, and if it contains 'date' just insert today's date.
@Kennric how will we determine the format of the date being printed in the string? For this specific use-case, we need a unix echo timestamp, but we may need others later.
@Kennric @ramereth For now I check for 'date' and insert the timestamp if 'date' is there. I interpreted "unix timestamp" as the regular "seconds since 1970" unix standard, is this correct?
leian@osuosl.org:Timestamp Test:1497398504:Annie Lei
@leian7 yes, that is correct
@Kennric can we please get this merged and deployed?
For #77 . Needed for osuosl-pelican's https://github.com/osuosl/osuosl-pelican/issues/159
Changes
fields_to_join
as described in #77 when it is providedformat_message
that includes afields_to_join
in the dummy POST requestfields_to_join
field if it existsTo run tests
make tests
To "send" a test email (unable to send actual email locally because it would require running a local smtp server)
request_handler.py
, comment out lines 467-481 and uncommentprint(msg_send)
on 466 insteadfields_to_join
or use the premade example intemplates
: navigate totemplates/
and dopython -m SimpleHTTPServer [port num that isn't 5000]
. Make sure yourform action
is to localhost:5000. You can also try including a nonexistent field infields_to_join
to test validation (see below for sample output).make run
in another terminalfields_to_join
were concatenated correctly if you supplied valid fields. Sample terminal output forindex.html
is below.Expected output
Contact:
NAME: Firstname Lastname EMAIL: firstlast@example.com
Information:
firstlast@example.com:Firstname Lastname
127.0.0.1 - - [02/Jun/2017 16:37:48] "POST / HTTP/1.1" 302 -