Module Import alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Return Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AugAssignBitOr NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AugAssignBitOr NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad Str attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareLt NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad BinOpAdd NameLoad Num orelse Expr Call AttributeLoad NameLoad attr Str NameLoad Return If CompareGtE AttributeLoad NameLoad attr Num body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return If BoolOpAnd CompareEq AttributeLoad NameLoad attr Num CompareEq SubscriptLoad NameLoad Index Str Num CompareLt NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad BinOpAdd NameLoad Num orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad AugAssignBitAnd NameStore UnaryOpInvert Call NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad GeneratorExp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad decorator_list Call NameLoad keyword NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call NameLoad NameLoad AugAssignBitAnd NameStore UnaryOpInvert Call NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call NameLoad keyword NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad For NameStore NameLoad body Expr Call NameLoad NameLoad decorator_list Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad
N/A N/A logging django.contrib.contenttypes.models ContentType django.db.models Q N/A actstream.registry N/A simplejson N/A requests actstream.models Action Follow celery task multidb.pinning use_master requests.exceptions RequestException kitsune.notifications.models Notification RealtimeRegistration PushNotificationRegistration kitsune.notifications.decorators notification_handler notification_handlers N/A logger N/A N/A logging getLogger k.notifications.tasks _ct_query N/A N/A object actor_only N/A None kwargs N/A N/A ct N/A N/A N/A ContentType objects get_for_model object N/A N/A actor_only None N/A N/A N/A kwargs N/A actor_only actor_only N/A N/A Q content_type N/A ct pk object_id N/A object pk kwargs N/A _full_ct_query N/A N/A action actor_only N/A None N/A N/A Build a query that matches objects with a content type that matches an action. N/A N/A N/A N/A actstream registry check N/A action actor N/A query N/A _ct_query N/A action actor N/A N/A N/A action target None N/A N/A N/A N/A N/A actstream registry check N/A action target N/A query N/A _ct_query N/A action target actor_only N/A N/A N/A action action_object None N/A N/A N/A N/A N/A actstream registry check N/A action action_object N/A query N/A _ct_query N/A action action_object actor_only N/A query N/A _send_simple_push N/A N/A endpoint version max_retries _retry_count N/A 3 0 N/A N/A 
    Hit a simple push endpoint to send a notification to a user.

    Handles and record any HTTP errors. May retry up to ``max_retries``
    times by recursing.

    This function tries hard to handle any potential errors, so it may
    be used in a loop that iterates over many actions to send, without
    the loop needing to contain error handling logic.

    @param endpoint: The url to PUT to.
    @param version: The version to include in the push. Should be an integer
        greater than the version used every other time this endpoint has
        been called. Timestamps and DB auto increment fields work well.
    @param max_retries: The maximum number of times to try again.
     N/A N/A N/A r N/A N/A requests put endpoint N/A N/A version={} format version N/A N/A N/A RequestException N/A e N/A N/A N/A _retry_count max_retries N/A N/A N/A _send_simple_push endpoint version max_retries N/A _retry_count 1 N/A N/A N/A N/A logger error SimplePush PUT failed: %s e N/A N/A N/A N/A r status_code 400 N/A N/A N/A N/A data N/A N/A r json N/A N/A N/A N/A N/A simplejson scanner JSONDecodeError N/A N/A N/A N/A logger error SimplePush error (also not JSON?!): %s %s N/A r status_code N/A r text N/A N/A N/A N/A N/A r status_code 503 N/A N/A data N/A errno 202 N/A _retry_count max_retries N/A N/A N/A _send_simple_push endpoint version max_retries N/A _retry_count 1 N/A N/A N/A N/A logger error SimplePush error: %s %s N/A r status_code N/A N/A r json N/A add_notification_for_action N/A N/A action_id N/A N/A N/A action N/A N/A N/A Action objects get id action_id N/A query N/A _full_ct_query action actor_only False N/A query N/A N/A Q user N/A action actor N/A users_to_notify N/A set N/A N/A f user N/A f N/A N/A N/A Follow objects filter query N/A u users_to_notify N/A N/A N/A N/A N/A Notification objects create owner u action action N/A N/A task ignore_result True use_master send_realtimes_for_action N/A N/A action_id N/A N/A N/A action N/A N/A N/A Action objects get id action_id N/A query N/A _full_ct_query action N/A query N/A N/A Q creator N/A action actor N/A registrations N/A N/A N/A RealtimeRegistration objects filter query N/A reg registrations N/A N/A N/A _send_simple_push N/A reg endpoint N/A action id N/A N/A task ignore_result True use_master send_notification N/A N/A notification_id N/A N/A N/A Call every notification handler for a notification. N/A notification N/A N/A N/A Notification objects get id notification_id N/A handler notification_handlers N/A N/A N/A handler notification N/A N/A task ignore_result True simple_push N/A N/A notification N/A N/A N/A 
    Send simple push notifications to users that have opted in to them.

    This will be called as a part of a celery task.
     N/A registrations N/A N/A N/A PushNotificationRegistration objects filter creator N/A notification owner N/A reg registrations N/A N/A N/A _send_simple_push N/A reg push_url N/A notification id N/A notification_handler