~homeworkprod/byceps

674b1e17653b9bb02f5764053a6c6f8ac1bb0b1f — Jochen Kupperschmidt 1 year, 2 months ago 4d998d2
Move signal modules from blueprint packages into new package `byceps.signals`
43 files changed, 137 insertions(+), 141 deletions(-)

M byceps/announce/discord/__init__.py
M byceps/announce/irc/board.py
M byceps/announce/irc/news.py
M byceps/announce/irc/shop_order.py
M byceps/announce/irc/snippet.py
M byceps/announce/irc/user.py
M byceps/announce/irc/user_badge.py
M byceps/blueprints/admin/news/views.py
M byceps/blueprints/admin/shop/order/views.py
M byceps/blueprints/admin/snippet/views.py
M byceps/blueprints/admin/ticketing/views.py
M byceps/blueprints/admin/user/views.py
M byceps/blueprints/admin/user_badge/views.py
M byceps/blueprints/api/v1/tourney/match/comments/views.py
M byceps/blueprints/api/v1/user/views.py
M byceps/blueprints/api/v1/user_badge/views.py
M byceps/blueprints/board/views_posting.py
M byceps/blueprints/board/views_topic.py
M byceps/blueprints/shop/order/views.py
M byceps/blueprints/shop/orders/views.py
M byceps/blueprints/user/avatar/views.py
M byceps/blueprints/user/creation/views.py
M byceps/blueprints/user/current/views.py
M byceps/blueprints/user/email_address/views.py
A byceps/signals/__init__.py
R byceps/{blueprints/board/signals.py => signals/board.py}
R byceps/{blueprints/news/signals.py => signals/news.py}
R byceps/{blueprints/shop/order/signals.py => signals/shop.py}
R byceps/{blueprints/snippet/signals.py => signals/snippet.py}
R byceps/{blueprints/ticketing/signals.py => signals/ticketing.py}
R byceps/{blueprints/api/v1/tourney/signals.py => signals/tourney.py}
R byceps/{blueprints/user/signals.py => signals/user.py}
R byceps/{blueprints/user/avatar/signals.py => signals/user_avatar.py}
R byceps/{blueprints/user_badge/signals.py => signals/user_badge.py}
M docs/concepts/signals.rst
M tests/integration/announce/irc/test_board.py
M tests/integration/announce/irc/test_news.py
M tests/integration/announce/irc/test_shop_order.py
M tests/integration/announce/irc/test_snippet.py
M tests/integration/announce/irc/test_user.py
M tests/integration/announce/irc/test_user_badge.py
M tests/integration/blueprints/admin/shop/order/test_views.py
M tests/integration/blueprints/site/shop/order/test_views.py
M byceps/announce/discord/__init__.py => byceps/announce/discord/__init__.py +3 -3
@@ 11,7 11,6 @@ Announce board events on Discord via its webhooks API.
from flask import current_app
import requests

from ...blueprints.board import signals
from ...events.board import BoardPostingCreated, BoardTopicCreated
from ...services.board import (
    posting_query_service as board_posting_query_service,


@@ 19,6 18,7 @@ from ...services.board import (
)
from ...services.brand import settings_service as brand_settings_service
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.jobqueue import enqueue




@@ 75,7 75,7 @@ def _get_webhook_url() -> str:
#       preview embedding on Discord.


@signals.topic_created.connect
@board_signals.topic_created.connect
def _on_board_topic_created(sender, *, event: BoardTopicCreated = None) -> None:
    enqueue(announce_board_topic_created, event)



@@ 93,7 93,7 @@ def announce_board_topic_created(event: BoardTopicCreated) -> None:
    send_message(text)


@signals.posting_created.connect
@board_signals.posting_created.connect
def _on_board_posting_created(
    sender, *, event: BoardPostingCreated = None
) -> None:

M byceps/announce/irc/board.py => byceps/announce/irc/board.py +12 -12
@@ 8,7 8,6 @@ Announce board events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.board import signals
from ...events.board import (
    BoardPostingCreated,
    BoardPostingHidden,


@@ 30,13 29,14 @@ from ...services.board import (
)
from ...services.brand import service as brand_service
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.irc import send_message
from ...util.jobqueue import enqueue

from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.topic_created.connect
@board_signals.topic_created.connect
def _on_board_topic_created(sender, *, event: BoardTopicCreated = None) -> None:
    enqueue(announce_board_topic_created, event)



@@ 57,7 57,7 @@ def announce_board_topic_created(event: BoardTopicCreated) -> None:
    send_message(channels, text)


@signals.topic_hidden.connect
@board_signals.topic_hidden.connect
def _on_board_topic_hidden(sender, *, event: BoardTopicHidden = None) -> None:
    enqueue(announce_board_topic_hidden, event)



@@ 80,7 80,7 @@ def announce_board_topic_hidden(event: BoardTopicHidden) -> None:
    send_message(channels, text)


@signals.topic_unhidden.connect
@board_signals.topic_unhidden.connect
def _on_board_topic_unhidden(
    sender, *, event: BoardTopicUnhidden = None
) -> None:


@@ 105,7 105,7 @@ def announce_board_topic_unhidden(event: BoardTopicUnhidden) -> None:
    send_message(channels, text)


@signals.topic_locked.connect
@board_signals.topic_locked.connect
def _on_board_topic_locked(sender, *, event: BoardTopicLocked = None) -> None:
    enqueue(announce_board_topic_locked, event)



@@ 128,7 128,7 @@ def announce_board_topic_locked(event: BoardTopicLocked) -> None:
    send_message(channels, text)


@signals.topic_unlocked.connect
@board_signals.topic_unlocked.connect
def _on_board_topic_unlocked(
    sender, *, event: BoardTopicUnlocked = None
) -> None:


@@ 153,7 153,7 @@ def announce_board_topic_unlocked(event: BoardTopicUnlocked) -> None:
    send_message(channels, text)


@signals.topic_pinned.connect
@board_signals.topic_pinned.connect
def _on_board_topic_pinned(sender, *, event: BoardTopicPinned = None) -> None:
    enqueue(announce_board_topic_pinned, event)



@@ 176,7 176,7 @@ def announce_board_topic_pinned(event: BoardTopicPinned) -> None:
    send_message(channels, text)


@signals.topic_unpinned.connect
@board_signals.topic_unpinned.connect
def _on_board_topic_unpinned(
    sender, *, event: BoardTopicUnpinned = None
) -> None:


@@ 201,7 201,7 @@ def announce_board_topic_unpinned(event: BoardTopicUnpinned) -> None:
    send_message(channels, text)


@signals.topic_moved.connect
@board_signals.topic_moved.connect
def _on_board_topic_moved(sender, *, event: BoardTopicMoved = None) -> None:
    enqueue(announce_board_topic_moved, event)



@@ 231,7 231,7 @@ def announce_board_topic_moved(event: BoardTopicMoved) -> None:
    send_message(channels, text)


@signals.posting_created.connect
@board_signals.posting_created.connect
def _on_board_posting_created(
    sender, *, event: BoardPostingCreated = None
) -> None:


@@ 257,7 257,7 @@ def announce_board_posting_created(event: BoardPostingCreated) -> None:
    send_message(channels, text)


@signals.posting_hidden.connect
@board_signals.posting_hidden.connect
def _on_board_posting_hidden(
    sender, *, event: BoardPostingHidden = None
) -> None:


@@ 282,7 282,7 @@ def announce_board_posting_hidden(event: BoardPostingHidden) -> None:
    send_message(channels, text)


@signals.posting_unhidden.connect
@board_signals.posting_unhidden.connect
def _on_board_posting_unhidden(
    sender, *, event: BoardPostingUnhidden = None
) -> None:

M byceps/announce/irc/news.py => byceps/announce/irc/news.py +2 -2
@@ 8,7 8,6 @@ Announce news events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.news import signals
from ...events.news import NewsItemPublished
from ...services.brand import service as brand_service
from ...services.news import (


@@ 16,13 15,14 @@ from ...services.news import (
    service as news_service,
)
from ...services.user import service as user_service
from ...signals import news as news_signals
from ...util.irc import send_message
from ...util.jobqueue import enqueue

from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.item_published.connect
@news_signals.item_published.connect
def _on_news_item_published(sender, *, event: NewsItemPublished = None) -> None:
    enqueue(announce_news_item_published_publicly, event)
    enqueue(announce_news_item_published_internally, event)

M byceps/announce/irc/shop_order.py => byceps/announce/irc/shop_order.py +4 -4
@@ 8,10 8,10 @@ Announce shop order events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.shop.order import signals
from ...events.shop import ShopOrderCanceled, ShopOrderPaid, ShopOrderPlaced
from ...services.shop.order import service as order_service
from ...services.user import service as user_service
from ...signals import shop as shop_signals
from ...typing import UserID
from ...util.irc import send_message
from ...util.jobqueue import enqueue


@@ 19,7 19,7 @@ from ...util.jobqueue import enqueue
from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.order_placed.connect
@shop_signals.order_placed.connect
def _on_order_placed(sender, *, event: ShopOrderPlaced) -> None:
    enqueue(announce_order_placed, event)



@@ 37,7 37,7 @@ def announce_order_placed(event: ShopOrderPlaced) -> None:
    send_message(channels, text)


@signals.order_paid.connect
@shop_signals.order_paid.connect
def _on_order_paid(sender, *, event: ShopOrderPaid) -> None:
    enqueue(announce_order_paid, event)



@@ 59,7 59,7 @@ def announce_order_paid(event: ShopOrderPaid) -> None:
    send_message(channels, text)


@signals.order_canceled.connect
@shop_signals.order_canceled.connect
def _on_order_canceled(sender, *, event: ShopOrderCanceled) -> None:
    enqueue(announce_order_canceled, event)


M byceps/announce/irc/snippet.py => byceps/announce/irc/snippet.py +4 -4
@@ 8,17 8,17 @@ Announce snippet events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.snippet import signals
from ...events.snippet import SnippetCreated, SnippetDeleted, SnippetUpdated
from ...services.snippet import service as snippet_service
from ...services.user import service as user_service
from ...signals import snippet as snippet_signals
from ...util.irc import send_message
from ...util.jobqueue import enqueue

from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.snippet_created.connect
@snippet_signals.snippet_created.connect
def _on_snippet_created(sender, *, event: SnippetCreated = None) -> None:
    enqueue(announce_snippet_created, event)



@@ 43,7 43,7 @@ def announce_snippet_created(event: SnippetCreated) -> None:
    send_message(channels, text)


@signals.snippet_updated.connect
@snippet_signals.snippet_updated.connect
def _on_snippet_updated(sender, *, event: SnippetUpdated = None) -> None:
    enqueue(announce_snippet_updated, event)



@@ 68,7 68,7 @@ def announce_snippet_updated(event: SnippetUpdated) -> None:
    send_message(channels, text)


@signals.snippet_deleted.connect
@snippet_signals.snippet_deleted.connect
def _on_snippet_deleted(sender, *, event: SnippetDeleted = None) -> None:
    enqueue(announce_snippet_deleted, event)


M byceps/announce/irc/user.py => byceps/announce/irc/user.py +8 -8
@@ 8,7 8,6 @@ Announce user events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.user import signals
from ...events.user import (
    UserAccountCreated,
    UserAccountDeleted,


@@ 19,13 18,14 @@ from ...events.user import (
    UserScreenNameChanged,
)
from ...services.user import service as user_service
from ...signals import user as user_signals
from ...util.irc import send_message
from ...util.jobqueue import enqueue

from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.account_created.connect
@user_signals.account_created.connect
def _on_user_account_created(sender, *, event: UserAccountCreated) -> None:
    enqueue(announce_user_account_created, event)



@@ 50,7 50,7 @@ def announce_user_account_created(event: UserAccountCreated) -> None:
    send_message(channels, text)


@signals.screen_name_changed.connect
@user_signals.screen_name_changed.connect
def _on_user_screen_name_changed(
    sender, *, event: UserScreenNameChanged
) -> None:


@@ 71,7 71,7 @@ def announce_user_screen_name_changed(event: UserScreenNameChanged) -> None:
    send_message(channels, text)


@signals.email_address_invalidated.connect
@user_signals.email_address_invalidated.connect
def _on_user_email_address_invalidated(
    sender, *, event: UserEmailAddressInvalidated
) -> None:


@@ 95,7 95,7 @@ def announce_user_email_address_invalidated(
    send_message(channels, text)


@signals.details_updated.connect
@user_signals.details_updated.connect
def _on_user_details_updated_changed(
    sender, *, event: UserDetailsUpdated
) -> None:


@@ 117,7 117,7 @@ def announce_user_details_updated_changed(event: UserDetailsUpdated) -> None:
    send_message(channels, text)


@signals.account_suspended.connect
@user_signals.account_suspended.connect
def _on_user_account_suspended(sender, *, event: UserAccountSuspended) -> None:
    enqueue(announce_user_account_suspended, event)



@@ 137,7 137,7 @@ def announce_user_account_suspended(event: UserAccountSuspended) -> None:
    send_message(channels, text)


@signals.account_unsuspended.connect
@user_signals.account_unsuspended.connect
def _on_user_account_unsuspended(
    sender, *, event: UserAccountUnsuspended
) -> None:


@@ 159,7 159,7 @@ def announce_user_account_unsuspended(event: UserAccountUnsuspended) -> None:
    send_message(channels, text)


@signals.account_deleted.connect
@user_signals.account_deleted.connect
def _on_user_account_deleted(sender, *, event: UserAccountDeleted) -> None:
    enqueue(announce_user_account_deleted, event)


M byceps/announce/irc/user_badge.py => byceps/announce/irc/user_badge.py +2 -2
@@ 8,17 8,17 @@ Announce user badge events on IRC.
:License: Modified BSD, see LICENSE for details.
"""

from ...blueprints.user_badge import signals
from ...events.user_badge import UserBadgeAwarded
from ...services.user import service as user_service
from ...services.user_badge import badge_service as user_badge_service
from ...signals import user_badge as user_badge_signals
from ...util.irc import send_message
from ...util.jobqueue import enqueue

from ._config import CHANNEL_ORGA_LOG, CHANNEL_PUBLIC


@signals.user_badge_awarded.connect
@user_badge_signals.user_badge_awarded.connect
def _on_user_badge_awarded(sender, *, event: UserBadgeAwarded) -> None:
    enqueue(announce_user_badge_awarded, event)


M byceps/blueprints/admin/news/views.py => byceps/blueprints/admin/news/views.py +2 -2
@@ 19,6 19,7 @@ from ....services.news import service as news_item_service
from ....services.news.transfer.models import Channel
from ....services.text_diff import service as text_diff_service
from ....services.user.service import UserIdRejected
from ....signals import news as news_signals
from ....util.datetime.format import format_datetime_short
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_success


@@ 28,7 29,6 @@ from ....util.views import redirect_to, respond_no_content

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...news import signals

from .authorization import NewsChannelPermission, NewsItemPermission
from .forms import (


@@ 448,7 448,7 @@ def item_publish(item_id):
        item.id, initiator_id=g.current_user.id
    )

    signals.item_published.send(None, event=event)
    news_signals.item_published.send(None, event=event)

    flash_success(f'Die News "{item.title}" wurde veröffentlicht.')


M byceps/blueprints/admin/shop/order/views.py => byceps/blueprints/admin/shop/order/views.py +3 -3
@@ 15,6 15,7 @@ from .....services.shop.order.transfer.models import PaymentMethod, PaymentState
from .....services.shop.shop import service as shop_service
from .....services.ticketing import ticket_service
from .....services.user import service as user_service
from .....signals import shop as shop_signals
from .....util.framework.blueprint import create_blueprint
from .....util.framework.flash import flash_error, flash_notice, flash_success
from .....util.framework.templating import templated


@@ 22,7 23,6 @@ from .....util.views import redirect_to, respond_no_content

from ....authorization.decorators import permission_required
from ....authorization.registry import permission_registry
from ....shop.order import signals

from .authorization import ShopOrderPermission
from .forms import CancelForm, MarkAsPaidForm


@@ 255,7 255,7 @@ def cancel(order_id):
            'Es wurde keine E-Mail an den/die Auftraggeber/in versendet.'
        )

    signals.order_canceled.send(None, event=event)
    shop_signals.order_canceled.send(None, event=event)

    return redirect_to('.view', order_id=order.id)



@@ 307,7 307,7 @@ def mark_as_paid(order_id):

    order_email_service.send_email_for_paid_order_to_orderer(order.id)

    signals.order_paid.send(None, event=event)
    shop_signals.order_paid.send(None, event=event)

    return redirect_to('.view', order_id=order.id)


M byceps/blueprints/admin/snippet/views.py => byceps/blueprints/admin/snippet/views.py +6 -6
@@ 13,6 13,7 @@ from ....services.site import service as site_service
from ....services.snippet import mountpoint_service, service as snippet_service
from ....services.snippet.transfer.models import Scope
from ....services.text_diff import service as text_diff_service
from ....signals import snippet as snippet_signals
from ....util.datetime.format import format_datetime_short
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_success


@@ 26,7 27,6 @@ from ....util.views import (

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...snippet import signals
from ...snippet.templating import get_snippet_context

from .authorization import SnippetMountpointPermission, SnippetPermission


@@ 194,7 194,7 @@ def create_document(scope_type, scope_name):

    flash_success(f'Das Dokument "{version.snippet.name}" wurde angelegt.')

    signals.snippet_created.send(None, event=event)
    snippet_signals.snippet_created.send(None, event=event)

    return redirect_to('.view_version', snippet_version_id=version.id)



@@ 248,7 248,7 @@ def update_document(snippet_id):

    flash_success(f'Das Dokument "{version.snippet.name}" wurde aktualisiert.')

    signals.snippet_updated.send(None, event=event)
    snippet_signals.snippet_updated.send(None, event=event)

    return redirect_to('.view_version', snippet_version_id=version.id)



@@ 333,7 333,7 @@ def create_fragment(scope_type, scope_name):

    flash_success(f'Das Fragment "{version.snippet.name}" wurde angelegt.')

    signals.snippet_created.send(None, event=event)
    snippet_signals.snippet_created.send(None, event=event)

    return redirect_to('.view_version', snippet_version_id=version.id)



@@ 379,7 379,7 @@ def update_fragment(snippet_id):

    flash_success(f'Das Fragment "{version.snippet.name}" wurde aktualisiert.')

    signals.snippet_updated.send(None, event=event)
    snippet_signals.snippet_updated.send(None, event=event)

    return redirect_to('.view_version', snippet_version_id=version.id)



@@ 438,7 438,7 @@ def delete_snippet(snippet_id):
        return url_for('.view_current_version', snippet_id=snippet.id)

    flash_success(f'Das Snippet "{snippet_name}" wurde gelöscht.')
    signals.snippet_deleted.send(None, event=event)
    snippet_signals.snippet_deleted.send(None, event=event)
    return url_for(
        '.index_for_scope', scope_type=scope.type_, scope_name=scope.name
    )

M byceps/blueprints/admin/ticketing/views.py => byceps/blueprints/admin/ticketing/views.py +2 -2
@@ 17,6 17,7 @@ from ....services.ticketing import (
    ticket_user_checkin_service,
    ticket_user_management_service,
)
from ....signals import ticketing as ticketing_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_notice, flash_success
from ....util.framework.templating import templated


@@ 24,7 25,6 @@ from ....util.views import respond_no_content

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...ticketing import signals

from .authorization import TicketingPermission
from .forms import SpecifyUserForm


@@ 153,7 153,7 @@ def set_user_checked_in_flag(ticket_id):
        )
        return

    signals.ticket_checked_in.send(None, event=event)
    ticketing_signals.ticket_checked_in.send(None, event=event)

    flash_success(f"Benutzer '{ticket.used_by.screen_name}' wurde eingecheckt.")


M byceps/blueprints/admin/user/views.py => byceps/blueprints/admin/user/views.py +7 -7
@@ 20,6 20,7 @@ from ....services.user import creation_service as user_creation_service
from ....services.user import service as user_service
from ....services.user import stats_service as user_stats_service
from ....services.user_badge import awarding_service as badge_awarding_service
from ....signals import user as user_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_success
from ....util.framework.templating import templated


@@ 27,7 28,6 @@ from ....util.views import redirect_to, respond_no_content

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...user import signals

from ..authorization.authorization import RolePermission



@@ 204,7 204,7 @@ def create_account():
            icon='email',
        )

    signals.account_created.send(None, event=event)
    user_signals.account_created.send(None, event=event)

    return redirect_to('.view', user_id=user.id)



@@ 305,7 305,7 @@ def suspend_account(user_id):

    event = user_command_service.suspend_account(user.id, initiator_id, reason)

    signals.account_suspended.send(None, event=event)
    user_signals.account_suspended.send(None, event=event)

    flash_success(f"Das Benutzerkonto '{user.screen_name}' wurde gesperrt.")
    return redirect_to('.view', user_id=user.id)


@@ 355,7 355,7 @@ def unsuspend_account(user_id):
        user.id, initiator_id, reason
    )

    signals.account_unsuspended.send(None, event=event)
    user_signals.account_unsuspended.send(None, event=event)

    flash_success(f"Das Benutzerkonto '{user.screen_name}' wurde entsperrt.")
    return redirect_to('.view', user_id=user.id)


@@ 405,7 405,7 @@ def delete_account(user_id):

    event = user_command_service.delete_account(user.id, initiator_id, reason)

    signals.account_deleted.send(None, event=event)
    user_signals.account_deleted.send(None, event=event)

    flash_success(f"Das Benutzerkonto '{user.screen_name}' wurde gelöscht.")
    return redirect_to('.view', user_id=user.id)


@@ 445,7 445,7 @@ def change_email_address(user_id):
        user.id, new_email_address, initiator_id, reason=reason
    )

    signals.email_address_changed.send(None, event=event)
    user_signals.email_address_changed.send(None, event=event)

    flash_success(
        f"Die E-Mail-Adresse des Benutzerkontos '{user.screen_name}' wurde "


@@ 488,7 488,7 @@ def change_screen_name(user_id):
        user.id, new_screen_name, initiator_id, reason=reason
    )

    signals.screen_name_changed.send(None, event=event)
    user_signals.screen_name_changed.send(None, event=event)

    flash_success(
        f"Das Benutzerkonto '{old_screen_name}' wurde "

M byceps/blueprints/admin/user_badge/views.py => byceps/blueprints/admin/user_badge/views.py +2 -2
@@ 11,6 11,7 @@ from flask import abort, g, request
from ....services.brand import service as brand_service
from ....services.user import service as user_service
from ....services.user_badge import awarding_service, badge_service
from ....signals import user_badge as user_badge_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_success
from ....util.framework.templating import templated


@@ 18,7 19,6 @@ from ....util.views import redirect_to

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...user_badge import signals

from .authorization import UserBadgePermission
from .forms import AwardForm, CreateForm


@@ 187,7 187,7 @@ def award(user_id):
        f'Das Abzeichen "{badge.label}" wurde an {user.screen_name} verliehen.'
    )

    signals.user_badge_awarded.send(None, event=event)
    user_badge_signals.user_badge_awarded.send(None, event=event)

    return redirect_to('user_admin.view', user_id=user.id)


M byceps/blueprints/api/v1/tourney/match/comments/views.py => byceps/blueprints/api/v1/tourney/match/comments/views.py +2 -3
@@ 25,13 25,12 @@ from .......services.tourney.transfer.models import (
)
from .......services.user import service as user_service
from .......services.user.transfer.models import User
from .......signals import tourney as tourney_signals
from .......util.framework.blueprint import create_blueprint
from .......util.views import respond_created, respond_no_content

from .....decorators import api_token_required

from ... import signals

from .schemas import (
    CreateMatchCommentRequest,
    ModerateMatchCommentRequest,


@@ 135,7 134,7 @@ def create():

    comment = comment_service.create_comment(match.id, creator.id, body)

    signals.match_comment_created.send(None, comment_id=comment.id)
    tourney_signals.match_comment_created.send(None, comment_id=comment.id)

    return url_for('.view', comment_id=comment.id)


M byceps/blueprints/api/v1/user/views.py => byceps/blueprints/api/v1/user/views.py +2 -3
@@ 14,12 14,11 @@ from .....services.user import (
    email_address_verification_service,
    service as user_service,
)
from .....signals import user as user_signals
from .....util.framework.blueprint import create_blueprint
from .....util.views import create_empty_json_response
from .....util.views import respond_no_content

from ....user.signals import email_address_invalidated

from .schemas import InvalidateEmailAddressRequest




@@ 64,4 63,4 @@ def invalidate_email_address():
        user.id, req['reason']
    )

    email_address_invalidated.send(None, event=event)
    user_signals.email_address_invalidated.send(None, event=event)

M byceps/blueprints/api/v1/user_badge/views.py => byceps/blueprints/api/v1/user_badge/views.py +2 -3
@@ 11,13 11,12 @@ from marshmallow import ValidationError

from .....services.user import service as user_service
from .....services.user_badge import awarding_service, badge_service
from .....signals import user_badge as user_badge_signals
from .....util.framework.blueprint import create_blueprint
from .....util.views import respond_no_content

from ...decorators import api_token_required

from ....user_badge import signals

from .schemas import AwardBadgeToUserRequest




@@ 54,4 53,4 @@ def award_badge_to_user():
        badge.id, user.id, initiator_id=initiator.id
    )

    signals.user_badge_awarded.send(None, event=event)
    user_badge_signals.user_badge_awarded.send(None, event=event)

M byceps/blueprints/board/views_posting.py => byceps/blueprints/board/views_posting.py +6 -5
@@ 17,6 17,7 @@ from ...services.board import (
)
from ...services.text_markup.service import get_smileys
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.framework.flash import flash_error, flash_success
from ...util.framework.templating import templated
from ...util.views import respond_no_content_with_location


@@ 26,7 27,7 @@ from ..authorization.decorators import permission_required
from .authorization import BoardPermission, BoardPostingPermission
from .blueprint import blueprint
from .forms import PostingCreateForm, PostingUpdateForm
from . import _helpers as h, service, signals
from . import _helpers as h, service


@blueprint.route('/postings/<uuid:posting_id>')


@@ 123,7 124,7 @@ def posting_create(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_posting(posting.id)
    )
    signals.posting_created.send(None, event=event)
    board_signals.posting_created.send(None, event=event)

    postings_per_page = service.get_postings_per_page_value()
    page_count = topic.count_pages(postings_per_page)


@@ 206,7 207,7 @@ def posting_update(posting_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_posting(posting.id)
    )
    signals.posting_updated.send(None, event=event)
    board_signals.posting_updated.send(None, event=event)

    return redirect(url)



@@ 242,7 243,7 @@ def posting_hide(posting_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_posting(posting.id)
    )
    signals.posting_hidden.send(None, event=event)
    board_signals.posting_hidden.send(None, event=event)

    return h.build_url_for_posting_in_topic_view(posting, page)



@@ 266,6 267,6 @@ def posting_unhide(posting_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_posting(posting.id)
    )
    signals.posting_unhidden.send(None, event=event)
    board_signals.posting_unhidden.send(None, event=event)

    return h.build_url_for_posting_in_topic_view(posting, page)

M byceps/blueprints/board/views_topic.py => byceps/blueprints/board/views_topic.py +10 -9
@@ 19,6 19,7 @@ from ...services.board import (
)
from ...services.text_markup.service import get_smileys
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.framework.flash import flash_error, flash_success
from ...util.framework.templating import templated
from ...util.views import respond_no_content_with_location


@@ 28,7 29,7 @@ from ..authorization.decorators import permission_required
from .authorization import BoardPermission, BoardTopicPermission
from .blueprint import blueprint
from .forms import PostingCreateForm, TopicCreateForm, TopicUpdateForm
from . import _helpers as h, service, signals
from . import _helpers as h, service


@blueprint.route('/topics', defaults={'page': 1})


@@ 166,7 167,7 @@ def topic_create(category_id):
    flash_success(f'Das Thema "{topic.title}" wurde hinzugefügt.')

    event = dataclasses.replace(event, url=topic_url)
    signals.topic_created.send(None, event=event)
    board_signals.topic_created.send(None, event=event)

    return redirect(topic_url)



@@ 278,7 279,7 @@ def topic_hide(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_hidden.send(None, event=event)
    board_signals.topic_hidden.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 300,7 301,7 @@ def topic_unhide(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_unhidden.send(None, event=event)
    board_signals.topic_unhidden.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 320,7 321,7 @@ def topic_lock(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_locked.send(None, event=event)
    board_signals.topic_locked.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 342,7 343,7 @@ def topic_unlock(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_unlocked.send(None, event=event)
    board_signals.topic_unlocked.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 362,7 363,7 @@ def topic_pin(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_pinned.send(None, event=event)
    board_signals.topic_pinned.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 382,7 383,7 @@ def topic_unpin(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_unpinned.send(None, event=event)
    board_signals.topic_unpinned.send(None, event=event)

    return h.build_url_for_topic_in_category_view(topic)



@@ 416,7 417,7 @@ def topic_move(topic_id):
    event = dataclasses.replace(
        event, url=h.build_external_url_for_topic(topic.id)
    )
    signals.topic_moved.send(None, event=event)
    board_signals.topic_moved.send(None, event=event)

    return redirect(h.build_url_for_topic_in_category_view(topic))


M byceps/blueprints/shop/order/views.py => byceps/blueprints/shop/order/views.py +2 -2
@@ 20,6 20,7 @@ from ....services.shop.shop import service as shop_service
from ....services.shop.storefront import service as storefront_service
from ....services.site import service as site_service
from ....services.user import service as user_service
from ....signals import shop as shop_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_notice, flash_success
from ....util.framework.templating import templated


@@ 28,7 29,6 @@ from ....util.views import redirect_to
from ...authentication.decorators import login_required

from .forms import assemble_articles_order_form, OrderForm
from . import signals


blueprint = create_blueprint('shop_order', __name__)


@@ 280,7 280,7 @@ def _place_order(storefront_id, orderer, cart):

    order_email_service.send_email_for_incoming_order_to_orderer(order.id)

    signals.order_placed.send(None, event=event)
    shop_signals.order_placed.send(None, event=event)

    return order


M byceps/blueprints/shop/orders/views.py => byceps/blueprints/shop/orders/views.py +2 -3
@@ 14,6 14,7 @@ from ....services.shop.order.transfer.models import PaymentState
from ....services.shop.storefront import service as storefront_service
from ....services.site import service as site_service
from ....services.snippet.transfer.models import Scope
from ....signals import shop as shop_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_success
from ....util.framework.templating import templated


@@ 22,8 23,6 @@ from ....util.views import redirect_to
from ...authentication.decorators import login_required
from ...snippet.templating import render_snippet_as_partial

from ..order import signals

from .forms import CancelForm




@@ 164,7 163,7 @@ def cancel(order_id):

    order_email_service.send_email_for_canceled_order_to_orderer(order.id)

    signals.order_canceled.send(None, event=event)
    shop_signals.order_canceled.send(None, event=event)

    return redirect_to('.view', order_id=order.id)


M byceps/blueprints/user/avatar/views.py => byceps/blueprints/user/avatar/views.py +2 -2
@@ 11,6 11,7 @@ from flask import abort, g, request
from ....services.image import service as image_service
from ....services.user import service as user_service
from ....services.user_avatar import service as avatar_service
from ....signals import user_avatar as user_avatar_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_notice, flash_success
from ....util.image.models import ImageType


@@ 18,7 19,6 @@ from ....util.framework.templating import templated
from ....util.views import redirect_to, respond_no_content

from .forms import UpdateForm
from . import signals


blueprint = create_blueprint('user_avatar', __name__)


@@ 67,7 67,7 @@ def update():
    _update(user.id, image)

    flash_success('Dein Avatarbild wurde aktualisiert.', icon='upload')
    signals.avatar_updated.send(None, user_id=user.id)
    user_avatar_signals.avatar_updated.send(None, user_id=user.id)

    return redirect_to('user_current.view')


M byceps/blueprints/user/creation/views.py => byceps/blueprints/user/creation/views.py +2 -3
@@ 26,13 26,12 @@ from ....services.terms import document_service as terms_document_service
from ....services.terms import version_service as terms_version_service
from ....services.terms.transfer.models import DocumentID as TermsDocumentID
from ....services.user import creation_service as user_creation_service
from ....signals import user as user_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_success
from ....util.framework.templating import templated
from ....util.views import redirect_to

from .. import signals

from .forms import UserCreateForm




@@ 170,7 169,7 @@ def create():
        'der an die angegebene Adresse verschickten E-Mail besucht werden.'
    )

    signals.account_created.send(None, event=event)
    user_signals.account_created.send(None, event=event)

    return redirect_to('authentication.login_form')


M byceps/blueprints/user/current/views.py => byceps/blueprints/user/current/views.py +3 -3
@@ 13,6 13,7 @@ from ....services.country import service as country_service
from ....services.newsletter import service as newsletter_service
from ....services.user import command_service as user_command_service
from ....services.user import service as user_service
from ....signals import user as user_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_success
from ....util.framework.templating import templated


@@ 21,7 22,6 @@ from ....util.views import redirect_to
from ...authentication.decorators import login_required

from ..creation.views import _find_newsletter_list_for_brand
from .. import signals

from .forms import DetailsForm, ChangeScreenNameForm



@@ 111,7 111,7 @@ def change_screen_name():
        current_user.id, new_screen_name, initiator_id
    )

    signals.screen_name_changed.send(None, event=event)
    user_signals.screen_name_changed.send(None, event=event)

    flash_success(f'Dein Benutzername wurde zu "{new_screen_name}" geändert.')



@@ 168,7 168,7 @@ def details_update():

    flash_success('Deine Daten wurden gespeichert.')

    signals.details_updated.send(None, event=event)
    user_signals.details_updated.send(None, event=event)

    return redirect_to('.view')


M byceps/blueprints/user/email_address/views.py => byceps/blueprints/user/email_address/views.py +2 -3
@@ 13,13 13,12 @@ from ....services.user import service as user_service
from ....services.verification_token import (
    service as verification_token_service,
)
from ....signals import user as user_signals
from ....util.framework.blueprint import create_blueprint
from ....util.framework.flash import flash_error, flash_notice, flash_success
from ....util.framework.templating import templated
from ....util.views import redirect_to

from .. import signals

from .forms import RequestConfirmationEmailForm




@@ 110,6 109,6 @@ def confirm(token):
        f'Das Benutzerkonto "{user.screen_name}" ist nun aktiviert.'
    )

    signals.email_address_confirmed.send(None, event=event)
    user_signals.email_address_confirmed.send(None, event=event)

    return redirect_to('authentication.login_form')

A byceps/signals/__init__.py => byceps/signals/__init__.py +0 -0
R byceps/blueprints/board/signals.py => byceps/signals/board.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.board
~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/news/signals.py => byceps/signals/news.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.news.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.news
~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/shop/order/signals.py => byceps/signals/shop.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.shop.order.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.shop
~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/snippet/signals.py => byceps/signals/snippet.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.snippet.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.snippet
~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/ticketing/signals.py => byceps/signals/ticketing.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.ticketing.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.ticketing
~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/api/v1/tourney/signals.py => byceps/signals/tourney.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.api.v1.tourney.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.tourney
~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/user/signals.py => byceps/signals/user.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.user.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.user
~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/user/avatar/signals.py => byceps/signals/user_avatar.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.user.avatar.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.user_avatar
~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/user_badge/signals.py => byceps/signals/user_badge.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.user_badge.signals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.signals.user_badge
~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

M docs/concepts/signals.rst => docs/concepts/signals.rst +4 -3
@@ 34,11 34,12 @@ the command line, e.g. for development and debugging).

.. code-block:: python

    from byceps.blueprints.board.signals import topic_created
    from byceps.events.board import BoardTopicCreated
    from byceps.signals.board import topic_created

    @topic_created.connect
    def celebrate_created_topic(sender, *, topic=None):
        print('A topic entitled "{}" has been created.'.format(topic.title))
    def celebrate_created_topic(sender, *, event: BoardTopicCreated = None) -> None:
        print(f'A topic titled has been created: {event.url}')

More useful reactions include:


M tests/integration/announce/irc/test_board.py => tests/integration/announce/irc/test_board.py +1 -1
@@ 6,7 6,6 @@
import pytest

from byceps.announce.irc import board  # Load signal handlers.
import byceps.blueprints.board.signals as board_signals
from byceps.events.board import (
    BoardPostingCreated,
    BoardPostingHidden,


@@ 25,6 24,7 @@ from byceps.services.board import (
    posting_command_service,
    topic_command_service,
)
from byceps.signals import board as board_signals

from .helpers import (
    assert_submitted_data,

M tests/integration/announce/irc/test_news.py => tests/integration/announce/irc/test_news.py +1 -1
@@ 6,12 6,12 @@
import pytest

from byceps.announce.irc import news  # Load signal handlers.
import byceps.blueprints.news.signals as news_signals
from byceps.events.news import NewsItemPublished
from byceps.services.news import (
    channel_service as news_channel_service,
    service as news_service,
)
from byceps.signals import news as news_signals

from .helpers import (
    assert_request_data,

M tests/integration/announce/irc/test_shop_order.py => tests/integration/announce/irc/test_shop_order.py +4 -4
@@ 6,7 6,6 @@
import pytest

from byceps.announce.irc import shop_order  # Load signal handlers.
from byceps.blueprints.shop.order import signals
from byceps.events.shop import ShopOrderCanceled, ShopOrderPaid, ShopOrderPlaced
from byceps.services.shop.cart.models import Cart
from byceps.services.shop.order import service as order_service


@@ 15,6 14,7 @@ from byceps.services.shop.sequence import service as sequence_service
from byceps.services.shop.shop import service as shop_service
from byceps.services.shop.storefront import service as storefront_service
from byceps.services.user import command_service as user_command_service
from byceps.signals import shop as shop_signals

from testfixtures.shop_order import create_orderer



@@ 37,7 37,7 @@ def test_shop_order_placed_announced(app, placed_order):
    )

    with mocked_irc_bot() as mock:
        signals.order_placed.send(None, event=event)
        shop_signals.order_placed.send(None, event=event)
        assert_submitted_data(mock, expected_channels, expected_text)




@@ 54,7 54,7 @@ def test_shop_order_canceled_announced(app, canceled_order, shop_admin):
    )

    with mocked_irc_bot() as mock:
        signals.order_canceled.send(None, event=event)
        shop_signals.order_canceled.send(None, event=event)
        assert_submitted_data(mock, expected_channels, expected_text)




@@ 71,7 71,7 @@ def test_shop_order_paid_announced(app, paid_order, shop_admin):
    )

    with mocked_irc_bot() as mock:
        signals.order_paid.send(None, event=event)
        shop_signals.order_paid.send(None, event=event)
        assert_submitted_data(mock, expected_channels, expected_text)



M tests/integration/announce/irc/test_snippet.py => tests/integration/announce/irc/test_snippet.py +6 -6
@@ 6,9 6,9 @@
import pytest

from byceps.announce.irc import snippet  # Load signal handlers.
from byceps.blueprints.snippet import signals
from byceps.services.snippet import service as snippet_service
from byceps.services.snippet.transfer.models import Scope
from byceps.signals import snippet as snippet_signals

from .helpers import assert_submitted_data, CHANNEL_ORGA_LOG, mocked_irc_bot



@@ 27,7 27,7 @@ def test_announce_snippet_document_created(
    _, event = created_document_version_and_event

    with mocked_irc_bot() as mock:
        signals.snippet_created.send(None, event=event)
        snippet_signals.snippet_created.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)



@@ 43,7 43,7 @@ def test_announce_snippet_fragment_created(
    _, event = created_fragment_version_and_event

    with mocked_irc_bot() as mock:
        signals.snippet_created.send(None, event=event)
        snippet_signals.snippet_created.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)



@@ 59,7 59,7 @@ def test_announce_snippet_document_updated(
    _, event = updated_document_version_and_event

    with mocked_irc_bot() as mock:
        signals.snippet_updated.send(None, event=event)
        snippet_signals.snippet_updated.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)



@@ 75,7 75,7 @@ def test_announce_snippet_fragment_updated(
    _, event = updated_fragment_version_and_event

    with mocked_irc_bot() as mock:
        signals.snippet_updated.send(None, event=event)
        snippet_signals.snippet_updated.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)



@@ 97,7 97,7 @@ def test_announce_snippet_fragment_deleted(app, scope, editor):
    assert success

    with mocked_irc_bot() as mock:
        signals.snippet_deleted.send(None, event=event)
        snippet_signals.snippet_deleted.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)


M tests/integration/announce/irc/test_user.py => tests/integration/announce/irc/test_user.py +1 -1
@@ 4,7 4,6 @@
"""

from byceps.announce.irc import user  # Load signal handlers.
import byceps.blueprints.user.signals as user_signals
from byceps.events.user import (
    UserAccountCreated,
    UserAccountDeleted,


@@ 15,6 14,7 @@ from byceps.events.user import (
    UserScreenNameChanged,
)
from byceps.services.user import command_service as user_command_service
from byceps.signals import user as user_signals

from .helpers import (
    assert_submitted_data,

M tests/integration/announce/irc/test_user_badge.py => tests/integration/announce/irc/test_user_badge.py +3 -4
@@ 4,9 4,8 @@
"""

from byceps.announce.irc import user_badge  # Load signal handlers.
from byceps.blueprints.user_badge import signals
from byceps.services.user_badge import awarding_service, badge_service

from byceps.signals import user_badge as user_badge_signals

from .helpers import assert_submitted_data, CHANNEL_ORGA_LOG, mocked_irc_bot



@@ 28,7 27,7 @@ def test_user_badge_awarding_announced_without_initiator(app, make_user):
    _, event = awarding_service.award_badge_to_user(badge.id, user.id)

    with mocked_irc_bot() as mock:
        signals.user_badge_awarded.send(None, event=event)
        user_badge_signals.user_badge_awarded.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)



@@ 51,6 50,6 @@ def test_user_badge_awarding_announced_with_initiator(
    )

    with mocked_irc_bot() as mock:
        signals.user_badge_awarded.send(None, event=event)
        user_badge_signals.user_badge_awarded.send(None, event=event)

        assert_submitted_data(mock, EXPECTED_CHANNELS, expected_text)

M tests/integration/blueprints/admin/shop/order/test_views.py => tests/integration/blueprints/admin/shop/order/test_views.py +5 -5
@@ 84,7 84,7 @@ def orderer(make_user_with_detail):
    return create_orderer(user)


@patch('byceps.blueprints.shop.order.signals.order_canceled.send')
@patch('byceps.signals.shop.order_canceled.send')
@patch('byceps.blueprints.admin.shop.order.views.order_email_service')
def test_cancel_before_paid(
    order_email_service_mock,


@@ 137,7 137,7 @@ def test_cancel_before_paid(
    order_service.delete_order(placed_order.id)


@patch('byceps.blueprints.shop.order.signals.order_canceled.send')
@patch('byceps.signals.shop.order_canceled.send')
@patch('byceps.blueprints.admin.shop.order.views.order_email_service')
def test_cancel_before_paid_without_sending_email(
    order_email_service_mock,


@@ 179,7 179,7 @@ def test_cancel_before_paid_without_sending_email(
    order_service.delete_order(placed_order.id)


@patch('byceps.blueprints.shop.order.signals.order_paid.send')
@patch('byceps.signals.shop.order_paid.send')
@patch('byceps.blueprints.admin.shop.order.views.order_email_service')
def test_mark_order_as_paid(
    order_email_service_mock,


@@ 222,8 222,8 @@ def test_mark_order_as_paid(
    order_service.delete_order(placed_order.id)


@patch('byceps.blueprints.shop.order.signals.order_canceled.send')
@patch('byceps.blueprints.shop.order.signals.order_paid.send')
@patch('byceps.signals.shop.order_canceled.send')
@patch('byceps.signals.shop.order_paid.send')
@patch('byceps.blueprints.admin.shop.order.views.order_email_service')
def test_cancel_after_paid(
    order_email_service_mock,

M tests/integration/blueprints/site/shop/order/test_views.py => tests/integration/blueprints/site/shop/order/test_views.py +2 -2
@@ 98,7 98,7 @@ def orderer(admin_app, user):
    return user


@patch('byceps.blueprints.shop.order.signals.order_placed.send')
@patch('byceps.signals.shop.order_placed.send')
@patch('byceps.blueprints.shop.order.views.order_email_service')
def test_order(
    order_email_service_mock,


@@ 157,7 157,7 @@ def test_order(
    order_service.delete_order(order.id)


@patch('byceps.blueprints.shop.order.signals.order_placed.send')
@patch('byceps.signals.shop.order_placed.send')
@patch('byceps.blueprints.shop.order.views.order_email_service')
def test_order_single(
    order_email_service_mock,