Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -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

7 changes: 5 additions & 2 deletions features/steps/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
3 changes: 2 additions & 1 deletion jam/plugins/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down