Skip to content
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

Add feedback form #65

Merged
merged 35 commits into from
Jul 3, 2019
Merged

Add feedback form #65

merged 35 commits into from
Jul 3, 2019

Conversation

nesnoj
Copy link
Member

@nesnoj nesnoj commented Jun 29, 2019

This new feedback form will allow users to give feedback about an app.

After submission, a mail will be send (using a dedicated WAM Exchange account) to the address which is specified in the app's app.cfg by param email (example). The credentials for the Exchange account are taken from env vars (obtained in settings.py).
@henhuy Is there a more secure way to obtain them?

See helpers.rst for details.

Message format:

Sie haben eine Nachricht über das Feedback-Formular der WAM erhalten.

App: stemp_abw
Absender: Peter Meyer (peter.meyer@gmx.de)
Betreff: Testbetreff
========================================
Hallo,

dies ist eine Testnachricht.

MfG
========================================
Bitte antworte nicht auf diese E-Mail, junger PadaWAM!
Gez. Obi WAM Kenobi

Additional features:

  • shows thank you page
  • checks for required env vars, shows error page if not available
  • on error during sending process, show error page

The send_email() function could be used for more notification stuff like status, errors etc.

@nesnoj nesnoj added the enhancement New feature or request label Jun 29, 2019
@nesnoj nesnoj requested a review from henhuy June 29, 2019 23:27
@nesnoj nesnoj self-assigned this Jun 29, 2019
@nesnoj
Copy link
Member Author

nesnoj commented Jun 30, 2019

Ok, fixed some Travis CI stuff but there're 2 errors left:

  1. exception import errors -> do not make sense to me :(
  2. exception too broad -> yes, but as fallback if error is unknown to log which one it is (cf. SO thread)

@Bachibouzouk any ideas how to handle this?

@Bachibouzouk
Copy link
Contributor

Ok, fixed some Travis CI stuff but there're 2 errors left:

1. exception import errors -> do not make sense to me :(

@Bachibouzouk any ideas how to handle this?

Add # pylint: disable=import-error (on the line(s)) for which you want to disable this import-error (I read https://github.com/ecederstrand/exchangelib/issues/543 that it could be caused by a module overwriting a builtin module, but I tried rename the module and the function and still got the error...)

@Bachibouzouk
Copy link
Contributor

2\. exception too broad -> yes, but as fallback if error is unknown to log which one it is (cf. [SO thread](https://stackoverflow.com/questions/30442236/how-to-prevent-too-broad-exception-in-this-case))

@Bachibouzouk any ideas how to handle this?

I think we can also add a # pylint: disable=broad-except on those lines. I think in general it is still good to try avoid the too broad except statements, this is why I didn't disable this warning flag.

@nesnoj
Copy link
Member Author

nesnoj commented Jul 2, 2019

Thank you @Bachibouzouk! I agree that it should remain enabled by default but it's also kind of absurd to keep it as long as there's no solution beside mockin' it out..
I didn't find a proper solution either so I'll just "fix" it as recommended.

@nesnoj nesnoj requested a review from Bachibouzouk July 2, 2019 11:56
@nesnoj nesnoj mentioned this pull request Jul 2, 2019
@nesnoj
Copy link
Member Author

nesnoj commented Jul 3, 2019

The only missing thing is disabling the button after submit to prevent multiple submits. This can be solved after the JS error #71 is fixed.

Copy link
Contributor

@henhuy henhuy left a comment

Choose a reason for hiding this comment

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

Wow! Very nice! Tried it and it worked nicely!
Only question I got: Why do you want to merge into dev instead of master?
regards

@henhuy
Copy link
Contributor

henhuy commented Jul 3, 2019

and one more question:
should we put WAM_EXCHANGE_* into config file instead of env as we did with the rest?

@nesnoj nesnoj removed the request for review from Bachibouzouk July 3, 2019 14:44
@nesnoj
Copy link
Member Author

nesnoj commented Jul 3, 2019

Thanks for reviewing!

Only question I got: Why do you want to merge into dev instead of master?
regards

Because we decided to follow the Driessen git branching model (cf. CONTRIBUTING.md). So all new features are merged into dev which is subsequently merged to master for releases.

should we put WAM_EXCHANGE_* into config file instead of env as we did with the rest?

Good point, I'll change this.

@nesnoj nesnoj merged commit 971f5e6 into dev Jul 3, 2019
@nesnoj nesnoj deleted the features/feedback_form branch July 3, 2019 16:48
@henhuy henhuy mentioned this pull request Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants