Skip to content

Add user defined callback to be called on every shell execution #13

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

igcybers
Copy link

Adds a user defined callback option which can be defined in settings.
This function will be called after every execution.

It helps with audit, e.g. saving all users executions into a database.

Copy link
Owner

@djk2 djk2 left a comment

Choose a reason for hiding this comment

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

Hi
Great thanks for extension of my lib.
What you prepared look good.
Nice idea to add callback - it could be very handy.

I have small request, if you could:

  • add info to CHANGELOG.md
  • upgrade version from VERSION = (2, 0, 1) =>VERSION = (2, 1, 0)

@@ -251,3 +259,36 @@ def get_context_data(self, **kwargs):
ctx['django_version'] = get_dj_version()
ctx['auto_import'] = str(self.runner.importer)
return ctx

def call_callback(self, request, response, code) -> None:
Copy link
Owner

Choose a reason for hiding this comment

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

If you could add some docstring will be nice.

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

Successfully merging this pull request may close these issues.

2 participants