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

Don't send notifications for actions performed by myself #216

Closed
okainov opened this issue Feb 14, 2018 · 3 comments
Closed

Don't send notifications for actions performed by myself #216

okainov opened this issue Feb 14, 2018 · 3 comments
Assignees

Comments

@okainov
Copy link
Contributor

okainov commented Feb 14, 2018

At the moment all actions are leading to notifications. But it doesn't seem useful when I'm creating\updating my test run by my own. It would be nice to have the same approach as Jira has - notify only if the item assigned to you AND the change was made by any other person except you.

@atodorov
Copy link
Member

This is a valid use-case, thanks for the suggestion. However it is not currently possible to implement. All email notifications are sent from post_save signals (which are issued internally by Django) and they are missing information about the current user performing the action.

I am looking at django-papertrail to see of it can help resolve this issue. So far it doesn't seem to be technically possible (in an elegant way) to have all the necessary information so that the signal handler sending the emails can perform a test like if changed_by != myself then send_email.

I will continue to investigate, there's got to be an easier solution for this.

FYI FundersClub/django-papertrail#10

@atodorov
Copy link
Member

atodorov commented Jul 9, 2018

Note: with the introduction of model history tracking we now have a pre_save signal handler that adds a reference to the old version of the model (for calculating the changelog automatically). This is true for all models that keep history.

This old instance should be available for post_save handlers that send emails.

@atodorov
Copy link
Member

atodorov commented Jul 9, 2018

For reference HistoryRequestMiddleware sets HistoricalRecords.thread.request

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

No branches or pull requests

2 participants