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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link
Member

atodorov commented Feb 18, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

atodorov commented Jul 9, 2018

For reference HistoryRequestMiddleware sets HistoricalRecords.thread.request

atodorov added a commit that referenced this issue Jul 18, 2018

Don't send emails for changes performed by myself. Fix #216
this also requires tracking history for TestRun objects!

@atodorov atodorov closed this in 531bc99 Jul 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.