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

DASH-1506: Emit Push notification events #66

Merged
merged 6 commits into from
Feb 3, 2021
Merged

Conversation

anderson12ho
Copy link
Contributor

Summary

Add emitter for push notification events

@anderson12ho anderson12ho force-pushed the anderson12ho/push-events branch 5 times, most recently from 5227a90 to 15adf68 Compare January 26, 2021 22:35
@anderson12ho anderson12ho force-pushed the anderson12ho/push-events branch 2 times, most recently from 57316c1 to c3bf606 Compare January 26, 2021 23:13
Comment on lines +263 to +265
def emit_microservice_message( # pylint: disable=keyword-arg-before-vararg
self, exchange, routing_key, event_type, priority=0, *args, **kwargs
):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pylint doesnt like having default value keyword arguments before *args, **kwargs but I don't want to refactor the signature at this time.

@@ -1,5 +1,5 @@
try:
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ImproperlyConfigured # pylint: disable=unused-import
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why this was necessary, but I think we can just import this without having the except case once we update our django version.

Comment on lines +59 to +65
args, a, kw, defaults = inspect.getargspec(func) # pylint: disable=deprecated-method

signature = inspect.formatargspec(args, a, kw, defaults)
signature = inspect.formatargspec(args, a, kw, defaults) # pylint: disable=deprecated-method
is_bound_method = hasattr(func, '__self__')
if is_bound_method:
args = args[1:] # Omit 'self'
callargs = inspect.formatargspec(args, a, kw, None)
callargs = inspect.formatargspec(args, a, kw, None) # pylint: disable=deprecated-method
Copy link
Contributor Author

Choose a reason for hiding this comment

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

getargspec and formatargspec are deprecated in python 3.5, didn't want to spend time figuring out the new replacements

@@ -166,6 +166,7 @@ def activate(self, func):
return get_wrapped(func, _wrapper_template, evaldict)

def _find_match(self, resource_type, **kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this function was super unintuitive using a for/else loop. I didn't want to refactor it since I don't know how it will be have. This is my workaround.

@tpilara tpilara merged commit d6185f2 into master Feb 3, 2021
@tpilara tpilara deleted the anderson12ho/push-events branch February 3, 2021 18:13
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