diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 5a1988f..6c3ce79 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -1,2 +1,18 @@ Contributing ============ + +We welcome contributions via [GitHub](https://github.com/CenterForOpenScience/jamdb). + +Before submitting your pull request, please make sure that all unit tests are passing, by running the command below: + +.. code:: bash + + behave + +To preview changes to the documentation, install the requirements in dev-requirements.txt, then run the following: + +.. code:: bash + + cd docs + make html + diff --git a/features/steps/plugins.py b/features/steps/plugins.py index 4523a76..1bd6561 100644 --- a/features/steps/plugins.py +++ b/features/steps/plugins.py @@ -19,8 +19,11 @@ def assert_called(context): if actual.get('from'): mail.set_from(actual.get('from')) - token = mail.add_substitution.call_args[0][1] - mail.add_substitution.assert_called_with(':token', token) + token = mail.add_substitution.call_args_list[0][0][1] + mail.add_substitution.assert_any_call(':token', token) + + user = mail.add_substitution.call_args_list[1][0][1] + mail.add_substitution.assert_any_call(':user', user) mail.add_filter.assert_any_call('templates', 'enable', 1) mail.add_filter.assert_any_call('templates', 'template_id', actual['template']) diff --git a/jam/plugins/user.py b/jam/plugins/user.py index 9c73dd7..1ae74e1 100644 --- a/jam/plugins/user.py +++ b/jam/plugins/user.py @@ -198,10 +198,11 @@ def post(self, handler): mail.set_from(self.from_email) mail.add_substitution(':token', user.token.decode()) + mail.add_substitution(':user', user.id) mail.add_filter('templates', 'enable', 1) mail.add_filter('templates', 'template_id', self.template) # Sendgrid requires subject text and html to be set to a non falsey value - # Its highly recommened that you overwrite these in your own templates + # It is highly recommended that you overwrite these in your own templates mail.set_subject('JamDB password reset') mail.set_text('Your temporary token is :token') mail.set_html('Your temporary token is :token')