~homeworkprod/byceps

0f1c294140a7ba4559d444f7cccd91dbea54e60b — Jochen Kupperschmidt 9 months ago 7af3c85
Rename request-scope variable `current_user` to `user`
89 files changed, 226 insertions(+), 238 deletions(-)

M byceps/blueprints/admin/authentication/login/views.py
M byceps/blueprints/admin/board/templates/admin/board/board_index_for_brand.html
M byceps/blueprints/admin/board/templates/admin/board/board_view.html
M byceps/blueprints/admin/brand/templates/admin/brand/index.html
M byceps/blueprints/admin/brand/templates/admin/brand/view.html
M byceps/blueprints/admin/core/templates/layout/admin/_current_user.html
M byceps/blueprints/admin/core/templates/layout/admin/_header.html
M byceps/blueprints/admin/core/templates/layout/admin/_navigation.html
M byceps/blueprints/admin/core/templates/macros/admin.html
M byceps/blueprints/admin/more/templates/admin/more/view_brand.html
M byceps/blueprints/admin/more/templates/admin/more/view_global.html
M byceps/blueprints/admin/more/templates/admin/more/view_party.html
M byceps/blueprints/admin/more/templates/admin/more/view_site.html
M byceps/blueprints/admin/news/templates/admin/news/channel_index_for_brand.html
M byceps/blueprints/admin/news/templates/admin/news/channel_view.html
M byceps/blueprints/admin/news/templates/admin/news/item_view_version.html
M byceps/blueprints/admin/news/views.py
M byceps/blueprints/admin/newsletter/templates/admin/newsletter/view_subscriptions.html
M byceps/blueprints/admin/orga/templates/admin/orga/persons_for_brand.html
M byceps/blueprints/admin/orga/views.py
M byceps/blueprints/admin/orga_team/templates/admin/orga_team/teams_for_party.html
M byceps/blueprints/admin/party/templates/admin/party/index.html
M byceps/blueprints/admin/party/templates/admin/party/index_for_brand.html
M byceps/blueprints/admin/party/templates/admin/party/view.html
M byceps/blueprints/admin/shop/article/templates/admin/shop/article/index_for_shop.html
M byceps/blueprints/admin/shop/article/templates/admin/shop/article/view.html
M byceps/blueprints/admin/shop/order/templates/admin/shop/order/_order_list.html
M byceps/blueprints/admin/shop/order/templates/admin/shop/order/_view_actions.html
M byceps/blueprints/admin/shop/order/templates/admin/shop/order/view.html
M byceps/blueprints/admin/shop/order/views.py
M byceps/blueprints/admin/shop/shop/templates/admin/shop/shop/view_for_brand.html
M byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/index_for_shop.html
M byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/view.html
M byceps/blueprints/admin/site/templates/admin/site/index.html
M byceps/blueprints/admin/site/templates/admin/site/index_for_brand.html
M byceps/blueprints/admin/site/templates/admin/site/view.html
M byceps/blueprints/admin/snippet/templates/admin/snippet/index_for_scope.html
M byceps/blueprints/admin/snippet/templates/admin/snippet/index_mountpoints.html
M byceps/blueprints/admin/snippet/templates/admin/snippet/view_version.html
M byceps/blueprints/admin/snippet/views.py
M byceps/blueprints/admin/ticketing/checkin/views.py
M byceps/blueprints/admin/ticketing/templates/admin/ticketing/view_ticket.html
M byceps/blueprints/admin/ticketing/views.py
M byceps/blueprints/admin/tourney/category/templates/admin/tourney/category/index.html
M byceps/blueprints/admin/tourney/tourney/templates/admin/tourney/tourney/index.html
M byceps/blueprints/admin/user/templates/admin/user/_view_account_actions.html
M byceps/blueprints/admin/user/templates/admin/user/index.html
M byceps/blueprints/admin/user/templates/admin/user/manage_roles.html
M byceps/blueprints/admin/user/templates/admin/user/view.html
M byceps/blueprints/admin/user/templates/admin/user/view_permissions.html
M byceps/blueprints/admin/user/views.py
M byceps/blueprints/admin/user_badge/templates/admin/user_badge/index.html
M byceps/blueprints/admin/user_badge/templates/admin/user_badge/view.html
M byceps/blueprints/admin/user_badge/views.py
M byceps/blueprints/common/authentication/password/forms.py
M byceps/blueprints/common/authentication/password/views.py
M byceps/blueprints/common/core/templates/layout/_current_user.html
M byceps/blueprints/common/core/templates/layout/_current_user_menu_items.html
M byceps/blueprints/common/core/views.py
M byceps/blueprints/site/authentication/login/views.py
M byceps/blueprints/site/board/_helpers.py
M byceps/blueprints/site/board/templates/site/board/_posting_inline_create_form.html
M byceps/blueprints/site/board/templates/site/board/_posting_view_actions.html
M byceps/blueprints/site/board/templates/site/board/category_view.html
M byceps/blueprints/site/board/templates/site/board/posting_update_form.html
M byceps/blueprints/site/board/templates/site/board/topic_moderate_form.html
M byceps/blueprints/site/board/templates/site/board/topic_update_form.html
M byceps/blueprints/site/board/templates/site/board/topic_view.html
M byceps/blueprints/site/board/views_category.py
M byceps/blueprints/site/board/views_posting.py
M byceps/blueprints/site/board/views_topic.py
M byceps/blueprints/site/dashboard/views.py
M byceps/blueprints/site/news/views.py
M byceps/blueprints/site/newsletter/views.py
M byceps/blueprints/site/seating/templates/site/seating/view_area.html
M byceps/blueprints/site/seating/views.py
M byceps/blueprints/site/shop/order/views.py
M byceps/blueprints/site/shop/orders/views.py
M byceps/blueprints/site/ticketing/templates/site/ticketing/index_mine.html
M byceps/blueprints/site/ticketing/views.py
M byceps/blueprints/site/user/avatar/views.py
M byceps/blueprints/site/user/current/views.py
M byceps/blueprints/site/user/settings/forms.py
M byceps/blueprints/site/user/settings/views.py
M byceps/blueprints/site/user_group/templates/site/user_group/index.html
M byceps/blueprints/site/user_group/views.py
M byceps/blueprints/site/user_message/views.py
M byceps/util/views.py
M tests/helpers.py
M byceps/blueprints/admin/authentication/login/views.py => byceps/blueprints/admin/authentication/login/views.py +3 -4
@@ 31,10 31,9 @@ blueprint = create_blueprint('authentication.login_admin', __name__)
@templated
def login_form():
    """Show login form."""
    if g.current_user.is_active:
    if g.user.is_active:
        flash_notice(
            f'Du bist bereits als Benutzer "{g.current_user.screen_name}" '
            'angemeldet.'
            f'Du bist bereits als Benutzer "{g.user.screen_name}" angemeldet.'
        )
        return redirect('/')



@@ 47,7 46,7 @@ def login_form():
@respond_no_content
def login():
    """Allow the user to authenticate with e-mail address and password."""
    if g.current_user.is_active:
    if g.user.is_active:
        return

    form = LoginForm(request.form)

M byceps/blueprints/admin/board/templates/admin/board/board_index_for_brand.html => byceps/blueprints/admin/board/templates/admin/board/board_index_for_brand.html +1 -1
@@ 17,7 17,7 @@
      </nav>
      <h1>Foren {{ render_extra_in_heading(boards|length) }}</h1>
    </div>
  {%- if g.current_user.has_permission(BoardPermission.create) %}
  {%- if g.user.has_permission(BoardPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.board_create_form', brand_id=brand.id) }}">{{ render_icon('add') }} <span>Forum erstellen</span></a>

M byceps/blueprints/admin/board/templates/admin/board/board_view.html => byceps/blueprints/admin/board/templates/admin/board/board_view.html +2 -2
@@ 17,7 17,7 @@
      </nav>
      <h1>{{ board_id }}</h1>
    </div>
  {%- if g.current_user.has_permission(BoardCategoryPermission.create) %}
  {%- if g.user.has_permission(BoardCategoryPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.category_create_form', board_id=board_id) }}">{{ render_icon('add') }} <span>Kategorie erstellen</span></a>


@@ 53,7 53,7 @@
        <td class="centered bignumber">{{ category.topic_count|separate_thousands }}</td>
        <td class="centered bignumber">{{ category.posting_count|separate_thousands }}</td>
        <td>
          {%- if g.current_user.has_permission(BoardCategoryPermission.update) -%}
          {%- if g.user.has_permission(BoardCategoryPermission.update) -%}
          <div class="dropdown">
            <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
            <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/brand/templates/admin/brand/index.html => byceps/blueprints/admin/brand/templates/admin/brand/index.html +1 -1
@@ 11,7 11,7 @@
    <div class="column-auto">
      <h1>Marken {{ render_extra_in_heading(brands|length) }}</h1>
    </div>
  {%- if g.current_user.has_permission(BrandPermission.create) %}
  {%- if g.user.has_permission(BrandPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form') }}">{{ render_icon('add') }} <span>Marke erstellen</span></a>

M byceps/blueprints/admin/brand/templates/admin/brand/view.html => byceps/blueprints/admin/brand/templates/admin/brand/view.html +2 -2
@@ 16,7 16,7 @@
      </nav>
      <h1>{{ brand.title }}</h1>
    </div>
  {%- if g.current_user.has_permission(BrandPermission.update) %}
  {%- if g.user.has_permission(BrandPermission.update) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.update_form', brand_id=brand.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>


@@ 58,7 58,7 @@
    <div class="column-auto">
      <h2>E-Mail-Konfiguration</h2>
    </div>
    {%- if email_config and g.current_user.has_permission(BrandPermission.update) %}
    {%- if email_config and g.user.has_permission(BrandPermission.update) %}
    <div class="column-auto">
      <div class="button-row button-row--right" style="margin-top: 2rem;">
        <a class="button button--compact" href="{{ url_for('.email_config_update_form', brand_id=brand.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>

M byceps/blueprints/admin/core/templates/layout/admin/_current_user.html => byceps/blueprints/admin/core/templates/layout/admin/_current_user.html +5 -5
@@ 4,20 4,20 @@


<div class="current-user">
  {%- if g.current_user.is_active %}
  {%- if g.user.is_active %}
  <div class="dropdown">
    <a href="{{ url_for('user_admin.view', user_id=g.current_user.id) }}" class="dropdown-toggle button button--clear">
      {{ render_user_avatar_32(g.current_user) }}
    <a href="{{ url_for('user_admin.view', user_id=g.user.id) }}" class="dropdown-toggle button button--clear">
      {{ render_user_avatar_32(g.user) }}
    </a>
    <ol class="dropdown-menu dropdown-menu--right">
      <li>
        <span class="dropdown-label label-and-name">
          <span class="label">Angemeldet als</span>
          <span class="name">{{ render_user_screen_name(g.current_user) }}</span>
          <span class="name">{{ render_user_screen_name(g.user) }}</span>
        </span>
      </li>
      <li class="dropdown-divider"></li>
      <li><a class="dropdown-item" href="{{ url_for('user_admin.view', user_id=g.current_user.id) }}">{{ render_icon('user-profile') }} Profil</a></li>
      <li><a class="dropdown-item" href="{{ url_for('user_admin.view', user_id=g.user.id) }}">{{ render_icon('user-profile') }} Profil</a></li>
      <li><a class="dropdown-item" href="{{ url_for('authentication.password.update_form') }}">{{ render_icon('password') }} Passwort ändern</a></li>
      <li class="dropdown-divider"></li>
      <li><a class="dropdown-item" data-action="logout" href="{{ url_for('authentication.login_admin.logout', _method='POST') }}">{{ render_icon('log-out') }} abmelden</a></li>

M byceps/blueprints/admin/core/templates/layout/admin/_header.html => byceps/blueprints/admin/core/templates/layout/admin/_header.html +1 -1
@@ 15,7 15,7 @@
          </div><!-- /.column -->
          <div class="column column--form">

            {%- if g.current_user.has_permission(UserPermission.view) %}
            {%- if g.user.has_permission(UserPermission.view) %}
            <form action="{{ url_for('user_admin.index') }}" class="single-row">
              <input type="search" name="search_term" placeholder="Benutzer-, Vor-, Nachname, E-Mail-Adresse" title="Benutzer suchen: Benutzer-, Vor-, Nachname, E-Mail-Adresse">
              <button type="submit" class="button" title="Suchen">{{ render_icon('search') }}</button>

M byceps/blueprints/admin/core/templates/layout/admin/_navigation.html => byceps/blueprints/admin/core/templates/layout/admin/_navigation.html +1 -1
@@ 10,7 10,7 @@
{%- endmacro %}


{%- if g.current_user.has_permission(AdminPermission.access) %}
{%- if g.user.has_permission(AdminPermission.access) %}

  {%- with
    current_page = current_page|default,

M byceps/blueprints/admin/core/templates/macros/admin.html => byceps/blueprints/admin/core/templates/macros/admin.html +2 -2
@@ 4,7 4,7 @@
{% macro render_navigation(navigation, current_page) %}
  <nav class="main">
    <ol>
      {%- for item in navigation.get_items(g.current_user) %}
      {%- for item in navigation.get_items(g.user) %}
      <li><a href="{{ item.endpoint }}" title="{{ item.label }}" class="nav-item{% if (item.id is not none) and (item.id == current_page) %} nav-item--current{% endif %}">
        {%- if item.icon %}<span class="nav-item-icon">{{ render_icon(item.icon) }}</span>{% endif -%}
        <span class="nav-item-label">{{ item.label }}</span>


@@ 17,7 17,7 @@

{% macro render_main_tabs(navigation, current_tab) -%}
  <ol class="main-tabs">
    {%- for item in navigation.get_items(g.current_user) %}
    {%- for item in navigation.get_items(g.user) %}
      {%- with is_current = (item.id is not none) and (item.id == current_tab) %}
    <li><a href="{{ item.endpoint }}"{% if is_current %} class="current"{% endif -%}>{% if item.icon %}{{ render_icon(item.icon) }} {% endif %}{{ item.label }}</a></li>
      {%- endwith %}

M byceps/blueprints/admin/more/templates/admin/more/view_brand.html => byceps/blueprints/admin/more/templates/admin/more/view_brand.html +1 -1
@@ 23,7 23,7 @@
    ('AGB', 'legal', url_for('terms_admin.view_document', document_id=brand.id), TermsPermission.view),
  ] %}
    {%- for label, icon, url, required_permission in items %}
      {%- if g.current_user.has_permission(required_permission) %}
      {%- if g.user.has_permission(required_permission) %}
        {%- call render_cell(icon_name=icon, href=url) %}
          {{ render_icon(icon) }} <span>{{ label }}</span>
        {%- endcall %}

M byceps/blueprints/admin/more/templates/admin/more/view_global.html => byceps/blueprints/admin/more/templates/admin/more/view_global.html +1 -1
@@ 22,7 22,7 @@
    ('Hintergrundjobs', 'pending', url_for('jobs_admin.index'), JobsPermission.view),
  ] %}
    {%- for label, icon, url, required_permission in items %}
      {%- if g.current_user.has_permission(required_permission) %}
      {%- if g.user.has_permission(required_permission) %}
        {%- call render_cell(icon_name=icon, href=url) %}
          {{ render_icon(icon) }} <span>{{ label }}</span>
        {%- endcall %}

M byceps/blueprints/admin/more/templates/admin/more/view_party.html => byceps/blueprints/admin/more/templates/admin/more/view_party.html +1 -1
@@ 19,7 19,7 @@
    ('Turniere', 'trophy', url_for('tourney_tourney_admin.index', party_id=party.id), TourneyPermission.view),
  ] %}
    {%- for label, icon, url, required_permission in items %}
      {%- if g.current_user.has_permission(required_permission) %}
      {%- if g.user.has_permission(required_permission) %}
        {%- call render_cell(icon_name=icon, href=url) %}
          {{ render_icon(icon) }} <span>{{ label }}</span>
        {%- endcall %}

M byceps/blueprints/admin/more/templates/admin/more/view_site.html => byceps/blueprints/admin/more/templates/admin/more/view_site.html +1 -1
@@ 18,7 18,7 @@
    ('Forum', 'board', url_for('board_admin.board_view', board_id=site.board_id) if site.board_id else '', BoardCategoryPermission.view, site.board_id is not none),
  ] %}
    {%- for label, icon, url, required_permission, precondition in items %}
      {%- if g.current_user.has_permission(required_permission) and precondition %}
      {%- if g.user.has_permission(required_permission) and precondition %}
        {%- call render_cell(icon_name=icon, href=url) %}
          {{ render_icon(icon) }} <span>{{ label }}</span>
        {%- endcall %}

M byceps/blueprints/admin/news/templates/admin/news/channel_index_for_brand.html => byceps/blueprints/admin/news/templates/admin/news/channel_index_for_brand.html +1 -1
@@ 16,7 16,7 @@
      </nav>
      <h1>{{ brand.title }} {{ render_extra_in_heading(channels|length) }}</h1>
    </div>
  {%- if g.current_user.has_permission(NewsChannelPermission.create) %}
  {%- if g.user.has_permission(NewsChannelPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.channel_create_form', brand_id=brand.id) }}">{{ render_icon('add') }} <span>News-Kanal erstellen</span></a>

M byceps/blueprints/admin/news/templates/admin/news/channel_view.html => byceps/blueprints/admin/news/templates/admin/news/channel_view.html +2 -2
@@ 30,7 30,7 @@
    <div class="column-auto">
      <h2>Newsposts {{ render_extra_in_heading(items.total) }}</h2>
    </div>
  {%- if g.current_user.has_permission(NewsItemPermission.create) %}
  {%- if g.user.has_permission(NewsItemPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.item_create_form', channel_id=channel.id) }}">{{ render_icon('add') }} <span>Newspost erstellen</span></a>


@@ 71,7 71,7 @@
          {%- endif %}
          <br>
        {%- filter dim %}
          {%- if g.current_user.has_permission(NewsItemPermission.view) %}
          {%- if g.user.has_permission(NewsItemPermission.view) %}
          {{ render_icon('history') }} <a href="{{ url_for('.item_list_versions', item_id=item.id) }}" title="Änderungshistorie ansehen">{{ render_datetime(item.current_version.created_at|utc_to_local_tz) }}</a>
          {%- else %}
          {{ render_datetime(item.current_version.created_at|utc_to_local_tz) }}

M byceps/blueprints/admin/news/templates/admin/news/item_view_version.html => byceps/blueprints/admin/news/templates/admin/news/item_view_version.html +3 -3
@@ 42,13 42,13 @@
  {%- with item = version.item %}

    <div class="button-row button-row--compact" style="float: right;">
      {%- if g.current_user.has_permission(NewsItemPermission.update) %}
      {%- if g.user.has_permission(NewsItemPermission.update) %}
      <a class="button" href="{{ url_for('.item_update_form', item_id=item.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
      <div class="dropdown">
        <button class="dropdown-toggle button"><span>{{ render_icon('chevron-down') }}</span></button>
        <ol class="dropdown-menu dropdown-menu--right">
          <li><a class="dropdown-item" href="{{ url_for('.image_create_form', item_id=item.id) }}">{{ render_icon('add') }} Bild hinzufügen</a></li>
          {%- if not item.published and g.current_user.has_permission(NewsItemPermission.publish) %}
          {%- if not item.published and g.user.has_permission(NewsItemPermission.publish) %}
          <li><a class="dropdown-item" data-action="item-publish-now" href="{{ url_for('.item_publish_now', item_id=item.id) }}">{{ render_icon('published') }} News jetzt veröffentlichen</a></li>
          <li><a class="dropdown-item" href="{{ url_for('.item_publish_later_form', item_id=item.id) }}">{{ render_icon('published') }} News später veröffentlichen</a></li>
          {%- endif %}


@@ 129,7 129,7 @@
                    <td>{{ image.attribution|fallback }}</td>
                  </tr>
                </table>
                {%- if g.current_user.has_permission(NewsItemPermission.update) -%}
                {%- if g.user.has_permission(NewsItemPermission.update) -%}
                <p><a class="button button--compact" href="{{ url_for('.image_update_form', image_id=image.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a></p>
                {%- endif -%}
              </div>

M byceps/blueprints/admin/news/views.py => byceps/blueprints/admin/news/views.py +5 -7
@@ 166,7 166,7 @@ def image_create(item_id):
    if not form.validate():
        return image_create_form(item.id, form)

    creator_id = g.current_user.id
    creator_id = g.user.id
    image = request.files.get('image')
    alt_text = form.alt_text.data.strip()
    caption = form.caption.data.strip()


@@ 377,7 377,7 @@ def item_create(channel_id):
        return item_create_form(channel.id, form)

    slug = form.slug.data.strip().lower()
    creator = g.current_user
    creator = g.user
    title = form.title.data.strip()
    body = form.body.data.strip()
    image_url_path = form.image_url_path.data.strip()


@@ 422,7 422,7 @@ def item_update(item_id):
    if not form.validate():
        return item_update_form(item.id, form)

    creator = g.current_user
    creator = g.user
    slug = form.slug.data.strip().lower()
    title = form.title.data.strip()
    body = form.body.data.strip()


@@ 467,7 467,7 @@ def item_publish_later(item_id):
    )

    event = news_item_service.publish_item(
        item.id, publish_at=publish_at, initiator_id=g.current_user.id
        item.id, publish_at=publish_at, initiator_id=g.user.id
    )

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


@@ 484,9 484,7 @@ def item_publish_now(item_id):
    """Publish a news item now."""
    item = _get_item_or_404(item_id)

    event = news_item_service.publish_item(
        item.id, initiator_id=g.current_user.id
    )
    event = news_item_service.publish_item(item.id, initiator_id=g.user.id)

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


M byceps/blueprints/admin/newsletter/templates/admin/newsletter/view_subscriptions.html => byceps/blueprints/admin/newsletter/templates/admin/newsletter/view_subscriptions.html +1 -1
@@ 27,7 27,7 @@
    </div>
  </div>

  {%- if g.current_user.has_permission(NewsletterPermission.export_subscribers) %}
  {%- if g.user.has_permission(NewsletterPermission.export_subscribers) %}
  <div class="button-row button-row--right">
    <div class="dropdown">
      <button class="dropdown-toggle button">

M byceps/blueprints/admin/orga/templates/admin/orga/persons_for_brand.html => byceps/blueprints/admin/orga/templates/admin/orga/persons_for_brand.html +2 -2
@@ 27,7 27,7 @@
  <h1>{{ title }} {{ render_extra_in_heading(orgas_with_birthdays|length) }}</h1>

  <div class="button-row button-row--right">
    {%- if g.current_user.has_permission(OrgaTeamPermission.administrate_memberships) %}
    {%- if g.user.has_permission(OrgaTeamPermission.administrate_memberships) %}
    <a class="button" href="{{ url_for('.create_orgaflag_form', brand_id=brand.id) }}">{{ render_icon('add') }} <span>Person zum Orga ernennen</span></a>
    {%- endif %}



@@ 94,7 94,7 @@
          {%- endif %}
        </td>
        <td>
          {%- if g.current_user.has_permission(OrgaTeamPermission.administrate_memberships) %}
          {%- if g.user.has_permission(OrgaTeamPermission.administrate_memberships) %}
          <div class="dropdown">
            <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
            <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/orga/views.py => byceps/blueprints/admin/orga/views.py +2 -2
@@ 94,7 94,7 @@ def create_orgaflag(brand_id):
        return create_orgaflag_form(brand.id, form)

    user = form.user.data
    initiator = g.current_user
    initiator = g.user

    orga_flag = orga_service.add_orga_flag(brand.id, user.id, initiator.id)



@@ 117,7 117,7 @@ def remove_orgaflag(brand_id, user_id):

    brand = orga_flag.brand
    user = orga_flag.user
    initiator = g.current_user
    initiator = g.user

    orga_service.remove_orga_flag(orga_flag, initiator.id)


M byceps/blueprints/admin/orga_team/templates/admin/orga_team/teams_for_party.html => byceps/blueprints/admin/orga_team/templates/admin/orga_team/teams_for_party.html +4 -4
@@ 33,11 33,11 @@
      </nav>
      <h1>{{ title }} {{ render_extra_in_heading(teams_and_members|length) }}</h1>
    </div>
    {%- if g.current_user.has_permission(OrgaTeamPermission.create) %}
    {%- if g.user.has_permission(OrgaTeamPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.team_create_form', party_id=party.id) }}">{{ render_icon('add') }} <span>Team erstellen</span></a>
        {%- if g.current_user.has_permission(OrgaTeamPermission.create) %}
        {%- if g.user.has_permission(OrgaTeamPermission.create) %}
        <div class="dropdown">
          <button class="dropdown-toggle button"><span>{{ render_icon('chevron-down') }}</span></button>
          <ol class="dropdown-menu dropdown-menu--right">


@@ 62,14 62,14 @@
        <div>{{ '%d %s'|format(member_total, 'Person' if member_total == 1 else 'Personen')|dim }}</div>
        {%- endif %}
      </div>
      {%- if g.current_user.has_permission(OrgaTeamPermission.administrate_memberships) %}
      {%- if g.user.has_permission(OrgaTeamPermission.administrate_memberships) %}
      <div class="column-auto">
        <div class="button-row button-row--compact button-row--right">
          <a class="button button--compact" href="{{ url_for('.membership_create_form', team_id=team.id) }}" title="Orga hinzufügen">{{ render_icon('add') }}</a>
          <div class="dropdown">
            <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
            <ol class="dropdown-menu dropdown-menu--right">
              {%- if not members and g.current_user.has_permission(OrgaTeamPermission.delete) %}
              {%- if not members and g.user.has_permission(OrgaTeamPermission.delete) %}
              <li><a class="dropdown-item" data-action="team-delete" href="{{ url_for('.team_delete', team_id=team.id) }}">{{ render_icon('remove') }} <span>Team entfernen</span></a></li>
              {%- else %}
              <li><span class="dropdown-item button--disabled">{{ render_icon('remove') }} <span>Team entfernen</span></span></li>

M byceps/blueprints/admin/party/templates/admin/party/index.html => byceps/blueprints/admin/party/templates/admin/party/index.html +1 -1
@@ 13,7 13,7 @@
    <div class="column-auto">
      <h1>{{ title }} {{ render_extra_in_heading(parties|length) }}</h1>
    </div>
    {%- if g.current_user.has_permission(PartyPermission.create) %}
    {%- if g.user.has_permission(PartyPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <div class="dropdown">

M byceps/blueprints/admin/party/templates/admin/party/index_for_brand.html => byceps/blueprints/admin/party/templates/admin/party/index_for_brand.html +1 -1
@@ 19,7 19,7 @@
      </nav>
      <h1>Partys {{ render_extra_in_heading(parties.total) }}</h1>
    </div>
  {%- if g.current_user.has_permission(PartyPermission.create) %}
  {%- if g.user.has_permission(PartyPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form', brand_id=brand.id) }}">{{ render_icon('add') }} <span>Party erstellen</span></a>

M byceps/blueprints/admin/party/templates/admin/party/view.html => byceps/blueprints/admin/party/templates/admin/party/view.html +1 -1
@@ 29,7 29,7 @@
  </h1>

  <div class="button-row button-row--right">
    {%- if g.current_user.has_permission(PartyPermission.update) %}
    {%- if g.user.has_permission(PartyPermission.update) %}
    <a class="button" href="{{ url_for('.update_form', party_id=party.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
    {%- endif %}
  </div>

M byceps/blueprints/admin/shop/article/templates/admin/shop/article/index_for_shop.html => byceps/blueprints/admin/shop/article/templates/admin/shop/article/index_for_shop.html +1 -1
@@ 12,7 12,7 @@
    <div class="column-auto">
      <h1>{{ title }} {{ render_extra_in_heading(articles.total) }}</h1>
    </div>
    {%- if g.current_user.has_permission(ShopArticlePermission.create) %}
    {%- if g.user.has_permission(ShopArticlePermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form', shop_id=shop.id) }}">{{ render_icon('add') }} <span>Artikel anlegen</span></a>

M byceps/blueprints/admin/shop/article/templates/admin/shop/article/view.html => byceps/blueprints/admin/shop/article/templates/admin/shop/article/view.html +2 -2
@@ 35,13 35,13 @@
    </div>
    <div class="column-auto">
      <div class="button-row button-row--right">
        {%- if g.current_user.has_permission(ShopArticlePermission.update) %}
        {%- if g.user.has_permission(ShopArticlePermission.update) %}
        <a class="button" href="{{ url_for('.update_form', article_id=article.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
        {%- endif %}
        <div class="dropdown">
          <button class="dropdown-toggle button"><span>{{ render_icon('chevron-down') }}</span></button>
          <ol class="dropdown-menu dropdown-menu--right">
            {%- if g.current_user.has_permission(ShopArticlePermission.update) %}
            {%- if g.user.has_permission(ShopArticlePermission.update) %}
            <li><a class="dropdown-item" href="{{ url_for('.attachment_create_form', article_id=article.id) }}">{{ render_icon('attached') }} Artikel anhängen</a></li>
            {%- endif %}
            <li><a class="dropdown-item" href="{{ url_for('.view_ordered', article_id=article.id) }}">{{ render_icon('users') }} Käufer auflisten</a></li>

M byceps/blueprints/admin/shop/order/templates/admin/shop/order/_order_list.html => byceps/blueprints/admin/shop/order/templates/admin/shop/order/_order_list.html +1 -1
@@ 49,7 49,7 @@
        {%- endif %}
      </td>
      <td>
        {%- if order.is_open and g.current_user.has_permission(ShopOrderPermission.mark_as_paid) %}
        {%- if order.is_open and g.user.has_permission(ShopOrderPermission.mark_as_paid) %}
        <a class="button button--compact" href="{{ url_for('shop_order_admin.mark_as_paid_form', order_id=order.id) }}" title="Bestellung als bezahlt markieren">{{ render_icon('payment') }}</a>
        {%- endif %}
      </td>

M byceps/blueprints/admin/shop/order/templates/admin/shop/order/_view_actions.html => byceps/blueprints/admin/shop/order/templates/admin/shop/order/_view_actions.html +2 -2
@@ 19,11 19,11 @@
        <li><a class="dropdown-item" data-action="order-resend-incoming-notification" href="{{ url_for('.resend_email_for_incoming_order_to_orderer', order_id=order.id) }}">{{ render_icon('email') }} E-Mail-Bestätigung erneut senden</a></li>
          {%- endif %}

          {%- if order.is_open and g.current_user.has_permission(ShopOrderPermission.mark_as_paid) %}
          {%- if order.is_open and g.user.has_permission(ShopOrderPermission.mark_as_paid) %}
        <li><a class="dropdown-item" href="{{ url_for('.mark_as_paid_form', order_id=order.id) }}">{{ render_icon('payment') }} Bestellung als bezahlt markieren</a></li>
          {%- endif %}

          {%- if g.current_user.has_permission(ShopOrderPermission.cancel) %}
          {%- if g.user.has_permission(ShopOrderPermission.cancel) %}
        <li><a class="dropdown-item" href="{{ url_for('.cancel_form', order_id=order.id) }}">{{ render_icon('disabled') }} Bestellung stornieren</a></li>
          {%- endif %}


M byceps/blueprints/admin/shop/order/templates/admin/shop/order/view.html => byceps/blueprints/admin/shop/order/templates/admin/shop/order/view.html +1 -1
@@ 43,7 43,7 @@
    <div class="column-auto">
      <h1>{{ render_order_payment_state(order.payment_state) }} {{ title }}</h1>
    </div>
    {%- if g.current_user.has_any_permission(
    {%- if g.user.has_any_permission(
      ShopOrderPermission.cancel,
      ShopOrderPermission.mark_as_paid,
      ShopOrderPermission.update

M byceps/blueprints/admin/shop/order/views.py => byceps/blueprints/admin/shop/order/views.py +7 -7
@@ 157,7 157,7 @@ def export(order_id):
def set_invoiced_flag(order_id):
    """Mark the order as invoiced."""
    order = _get_order_or_404(order_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    order_service.set_invoiced_flag(order.id, initiator_id)



@@ 173,7 173,7 @@ def set_invoiced_flag(order_id):
def unset_invoiced_flag(order_id):
    """Mark the order as not invoiced."""
    order = _get_order_or_404(order_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    order_service.unset_invoiced_flag(order.id, initiator_id)



@@ 189,7 189,7 @@ def unset_invoiced_flag(order_id):
def set_shipped_flag(order_id):
    """Mark the order as shipped."""
    order = _get_order_or_404(order_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    order_service.set_shipped_flag(order.id, initiator_id)



@@ 204,7 204,7 @@ def set_shipped_flag(order_id):
def unset_shipped_flag(order_id):
    """Mark the order as not shipped."""
    order = _get_order_or_404(order_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    order_service.unset_shipped_flag(order.id, initiator_id)



@@ 261,7 261,7 @@ def cancel(order_id):
    send_email = form.send_email.data

    try:
        event = order_service.cancel_order(order.id, g.current_user.id, reason)
        event = order_service.cancel_order(order.id, g.user.id, reason)
    except order_service.OrderAlreadyCanceled:
        flash_error(
            'Die Bestellung ist bereits storniert worden; '


@@ 327,7 327,7 @@ def mark_as_paid(order_id):
        return mark_as_paid_form(order_id, form)

    payment_method = PaymentMethod[form.payment_method.data]
    updated_by_id = g.current_user.id
    updated_by_id = g.user.id

    try:
        event = order_service.mark_order_as_paid(


@@ 359,7 359,7 @@ def resend_email_for_incoming_order_to_orderer(order_id):
    """Resend the e-mail to the orderer to confirm that the order was placed."""
    order = _get_order_or_404(order_id)

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    order_email_service.send_email_for_incoming_order_to_orderer(order.id)


M byceps/blueprints/admin/shop/shop/templates/admin/shop/shop/view_for_brand.html => byceps/blueprints/admin/shop/shop/templates/admin/shop/shop/view_for_brand.html +1 -1
@@ 11,7 11,7 @@
  <div class="dimmed-box centered">
    <p>Für diese Marke existiert noch kein Shop.</p>

    {%- if g.current_user.has_permission(ShopPermission.create) %}
    {%- if g.user.has_permission(ShopPermission.create) %}
    <div class="button-row button-row--center">
      <a class="button" data-action="create-shop" href="{{ url_for('.create', brand_id=brand.id) }}">{{ render_icon('add') }} <span>Shop erstellen</span></a>
    </div>

M byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/index_for_shop.html => byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/index_for_shop.html +2 -2
@@ 12,10 12,10 @@
    </div>
    <div class="column-auto">
      <div class="button-row button-row--right">
        {%- if g.current_user.has_permission(ShopPermission.create) %}
        {%- if g.user.has_permission(ShopPermission.create) %}
        <a class="button" href="{{ url_for('.create_form', shop_id=shop.id) }}">{{ render_icon('add') }} <span>Storefront anlegen</span></a>
        {%- endif %}
        {%- if g.current_user.has_permission(ShopPermission.update) %}
        {%- if g.user.has_permission(ShopPermission.update) %}
        <div class="dropdown">
          <button class="dropdown-toggle button"><span>{{ render_icon('chevron-down') }}</span></button>
          <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/view.html => byceps/blueprints/admin/shop/storefront/templates/admin/shop/storefront/view.html +1 -1
@@ 9,7 9,7 @@
    <div class="column-auto">
      <h1>{{ title }}</h1>
    </div>
    {%- if g.current_user.has_permission(ShopPermission.update) %}
    {%- if g.user.has_permission(ShopPermission.update) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.update_form', storefront_id=storefront.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>

M byceps/blueprints/admin/site/templates/admin/site/index.html => byceps/blueprints/admin/site/templates/admin/site/index.html +1 -1
@@ 12,7 12,7 @@
    <div class="column-auto">
      <h1>{{ title }} {{ render_extra_in_heading(sites|length) }}</h1>
    </div>
    {%- if g.current_user.has_permission(SitePermission.create) %}
    {%- if g.user.has_permission(SitePermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <div class="dropdown">

M byceps/blueprints/admin/site/templates/admin/site/index_for_brand.html => byceps/blueprints/admin/site/templates/admin/site/index_for_brand.html +1 -1
@@ 13,7 13,7 @@
    <div class="column-auto">
      <h1>{{ title }} {{ render_extra_in_heading(sites|length) }}</h1>
    </div>
    {%- if g.current_user.has_permission(SitePermission.create) %}
    {%- if g.user.has_permission(SitePermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form', brand_id=brand.id) }}"><span>{{ render_icon('add') }} Site erstellen</span></a>

M byceps/blueprints/admin/site/templates/admin/site/view.html => byceps/blueprints/admin/site/templates/admin/site/view.html +1 -1
@@ 27,7 27,7 @@
    {%- endif -%}
  </h1>

  {%- if g.current_user.has_permission(SitePermission.update) %}
  {%- if g.user.has_permission(SitePermission.update) %}
  <div class="button-row button-row--compact" style="float: right;">
    <a class="button" href="{{ url_for('.update_form', site_id=site.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
  </div>

M byceps/blueprints/admin/snippet/templates/admin/snippet/index_for_scope.html => byceps/blueprints/admin/snippet/templates/admin/snippet/index_for_scope.html +4 -4
@@ 39,7 39,7 @@
    <div class="column-auto">
      <h2>Snippets {{ render_extra_in_heading(snippets|length) }}</h2>
    </div>
  {%- if g.current_user.has_permission(SnippetPermission.create) %}
  {%- if g.user.has_permission(SnippetPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <div class="dropdown">


@@ 76,7 76,7 @@
          <a href="{{ url_for('.view_current_version', snippet_id=snippet.id) }}"><strong>{{ snippet.name }}</strong></a>
        </td>
        <td class="nowrap">
          {%- if g.current_user.has_permission(SnippetPermission.view_history) %}
          {%- if g.user.has_permission(SnippetPermission.view_history) %}
          {{ render_icon('history') }} <a href="{{ url_for('.history', snippet_id=snippet.id) }}" title="Änderungshistorie ansehen">{{ render_datetime(snippet.current_version.created_at|utc_to_local_tz) }}</a>
          {%- else %}
          {{ render_datetime(snippet.current_version.created_at|utc_to_local_tz) }}


@@ 85,12 85,12 @@
        <td>{{ render_user_avatar_20_and_name(snippet.current_version.creator) }}</td>
        <td>
          <div class="button-row button-row--compact button-row--right">
            {%- if g.current_user.has_permission(SnippetPermission.update) %}
            {%- if g.user.has_permission(SnippetPermission.update) %}
              {%- with endpoint = '.update_fragment_form' if snippet.is_fragment else '.update_document_form' %}
            <a href="{{ url_for(endpoint, snippet_id=snippet.id) }}" class="button button--compact" title="Bearbeiten">{{ render_icon('edit') }}</a>
              {%- endwith %}
            {%- endif %}
            {%- if snippet.is_document and g.current_user.has_permission(SnippetMountpointPermission.create) %}
            {%- if snippet.is_document and g.user.has_permission(SnippetMountpointPermission.create) %}
            <div class="dropdown">
              <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
              <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/snippet/templates/admin/snippet/index_mountpoints.html => byceps/blueprints/admin/snippet/templates/admin/snippet/index_mountpoints.html +1 -1
@@ 55,7 55,7 @@
          <span class="dimmed">{{ snippet.scope.type_ }}/{{ snippet.scope.name }}</span>
        </td>
        <td>
        {%- if g.current_user.has_permission(SnippetMountpointPermission.delete) %}
        {%- if g.user.has_permission(SnippetMountpointPermission.delete) %}
          <div class="dropdown">
            <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
            <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/snippet/templates/admin/snippet/view_version.html => byceps/blueprints/admin/snippet/templates/admin/snippet/view_version.html +2 -2
@@ 35,13 35,13 @@

    <div class="button-row button-row--compact" style="float: right;">

      {%- if g.current_user.has_permission(SnippetPermission.update) -%}
      {%- if g.user.has_permission(SnippetPermission.update) -%}
        {%- with endpoint = '.update_fragment_form' if snippet.is_fragment else '.update_document_form' %}
      <a class="button" href="{{ url_for(endpoint, snippet_id=snippet.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
        {%- endwith %}
      {%- endif -%}

      {%- if g.current_user.has_permission(SnippetPermission.delete) %}
      {%- if g.user.has_permission(SnippetPermission.delete) %}
      <div class="dropdown">
        <button class="dropdown-toggle button"><span>{{ render_icon('chevron-down') }}</span></button>
        <ol class="dropdown-menu dropdown-menu--right">

M byceps/blueprints/admin/snippet/views.py => byceps/blueprints/admin/snippet/views.py +5 -5
@@ 176,7 176,7 @@ def create_document(scope_type, scope_name):
    form = DocumentCreateForm(request.form)

    name = form.name.data.strip().lower()
    creator = g.current_user
    creator = g.user
    title = form.title.data.strip()
    head = form.head.data.strip()
    body = form.body.data.strip()


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

    snippet = _find_snippet_by_id(snippet_id)

    creator = g.current_user
    creator = g.user
    title = form.title.data.strip()
    head = form.head.data.strip()
    body = form.body.data.strip()


@@ 324,7 324,7 @@ def create_fragment(scope_type, scope_name):
    form = FragmentCreateForm(request.form)

    name = form.name.data.strip().lower()
    creator = g.current_user
    creator = g.user
    body = form.body.data.strip()

    version, event = snippet_service.create_fragment(


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

    snippet = _find_snippet_by_id(snippet_id)

    creator = g.current_user
    creator = g.user
    body = form.body.data.strip()

    version, event = snippet_service.update_fragment(


@@ 427,7 427,7 @@ def delete_snippet(snippet_id):
    scope = snippet.scope

    success, event = snippet_service.delete_snippet(
        snippet.id, initiator_id=g.current_user.id
        snippet.id, initiator_id=g.user.id
    )

    if not success:

M byceps/blueprints/admin/ticketing/checkin/views.py => byceps/blueprints/admin/ticketing/checkin/views.py +2 -2
@@ 113,7 113,7 @@ def check_in_user(party_id, ticket_id):
    party = _get_party_or_404(party_id)
    ticket = _get_ticket_or_404(ticket_id)

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    try:
        event = ticket_user_checkin_service.check_in_user(


@@ 161,7 161,7 @@ def revert_user_check_in(ticket_id):
    """Revert the user check-in state."""
    ticket = _get_ticket_or_404(ticket_id)

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    ticket_user_checkin_service.revert_user_check_in(ticket.id, initiator_id)


M byceps/blueprints/admin/ticketing/templates/admin/ticketing/view_ticket.html => byceps/blueprints/admin/ticketing/templates/admin/ticketing/view_ticket.html +2 -2
@@ 24,13 24,13 @@
    {%- if ticket.user_checked_in %} {{ render_ticket_flag_user_checked_in() }}{% endif -%}
  </h1>

  {%- if not ticket.revoked and g.current_user.has_any_permission(TicketingPermission.administrate, TicketingPermission.checkin) %}
  {%- if not ticket.revoked and g.user.has_any_permission(TicketingPermission.administrate, TicketingPermission.checkin) %}
  <div style="float: right; margin-left: 40px;">
    <div class="dropdown">
      <button class="dropdown-toggle button"><span>Aktionen</span> {{ render_icon('chevron-down') }}</button>
      <ol class="dropdown-menu dropdown-menu--right">
        <li><a class="dropdown-item" href="{{ url_for('.appoint_user_form', ticket_id=ticket.id) }}">{{ render_icon('arrow-right') }} Nutzer/in zuweisen</a></li>
        {%- if g.current_user.has_permission(TicketingPermission.administrate) and not ticket.user_checked_in %}
        {%- if g.user.has_permission(TicketingPermission.administrate) and not ticket.user_checked_in %}
        <li><a class="dropdown-item" data-action="update-code" href="{{ url_for('.update_code', ticket_id=ticket.id) }}">{{ render_icon('edit') }} Code ändern</a></li>
        {%- endif %}
        {%- if ticket.user_checked_in %}

M byceps/blueprints/admin/ticketing/views.py => byceps/blueprints/admin/ticketing/views.py +2 -2
@@ 132,7 132,7 @@ def update_code(ticket_id):
        return update_code_form(ticket.id, form)

    code = form.code.data
    manager = g.current_user
    manager = g.user

    ticket_service.update_ticket_code(ticket.id, code, manager.id)



@@ 173,7 173,7 @@ def appoint_user(ticket_id):

    ticket = _get_ticket_or_404(ticket_id)
    user = form.user.data
    manager = g.current_user
    manager = g.user

    ticket_user_management_service.appoint_user(ticket.id, user.id, manager.id)


M byceps/blueprints/admin/tourney/category/templates/admin/tourney/category/index.html => byceps/blueprints/admin/tourney/category/templates/admin/tourney/category/index.html +2 -2
@@ 15,7 15,7 @@
  </nav>
  <h1>Kategorien {{ render_extra_in_heading(categories|length) }}</h1>

  {%- if g.current_user.has_permission(TourneyCategoryPermission.administrate) %}
  {%- if g.user.has_permission(TourneyCategoryPermission.administrate) %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.create_form', party_id=party.id) }}">{{ render_icon('add') }} <span>Kategorie erstellen</span></a>
  </div>


@@ 36,7 36,7 @@
        <td class="number">{{ category.position }}</td>
        <td>{{ category.title }}</td>
        <td>
          {%- if g.current_user.has_permission(TourneyCategoryPermission.administrate) -%}
          {%- if g.user.has_permission(TourneyCategoryPermission.administrate) -%}
          <div class="dropdown">
            <button class="dropdown-toggle button button--compact">{{ render_icon('chevron-down') }}</button>
            <ol class="dropdown-menu">

M byceps/blueprints/admin/tourney/tourney/templates/admin/tourney/tourney/index.html => byceps/blueprints/admin/tourney/tourney/templates/admin/tourney/tourney/index.html +2 -2
@@ 15,7 15,7 @@
  </nav>
  <h1>Turniere {{ render_extra_in_heading(tourneys|length) }}</h1>

  {%- if g.current_user.has_permission(TourneyPermission.administrate) %}
  {%- if g.user.has_permission(TourneyPermission.administrate) %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.create_form', party_id=party.id) }}">{{ render_icon('add') }} <span>Turnier erstellen</span></a>
  </div>


@@ 45,7 45,7 @@
        <td class="bignumber">{{ tourney.max_participant_count }}</td>
        <td>{{ render_datetime(tourney.starts_at|utc_to_local_tz) }}</td>
        <td>
          {%- if g.current_user.has_permission(TourneyPermission.administrate) %}
          {%- if g.user.has_permission(TourneyPermission.administrate) %}
          <div class="button-row button-row--compact">
            <a class="button button--compact" href="{{ url_for('.update_form', tourney_id=tourney.id) }}">{{ render_icon('edit', title='Turnier bearbeiten') }}</a>
          </div>

M byceps/blueprints/admin/user/templates/admin/user/_view_account_actions.html => byceps/blueprints/admin/user/templates/admin/user/_view_account_actions.html +3 -3
@@ 1,14 1,14 @@
{%- from 'macros/icons.html' import render_icon %}

  {%- if not user.deleted and g.current_user.has_any_permission(UserPermission.administrate, UserPermission.set_password) %}
  {%- if not user.deleted and g.user.has_any_permission(UserPermission.administrate, UserPermission.set_password) %}
  <div style="float: right; margin-left: 40px;">
    <div class="dropdown">
      <button class="dropdown-toggle button"><span>Aktionen</span> {{ render_icon('chevron-down') }}</button>
      <ol class="dropdown-menu dropdown-menu--right">
        {%- if g.current_user.has_permission(UserPermission.set_password) %}
        {%- if g.user.has_permission(UserPermission.set_password) %}
        <li><a class="dropdown-item" href="{{ url_for('.set_password', user_id=user.id) }}">{{ render_icon('password') }} Passwort ändern</a></li>
        {%- endif %}
        {%- if g.current_user.has_permission(UserPermission.administrate) %}
        {%- if g.user.has_permission(UserPermission.administrate) %}

          {%- if not user.initialized %}
        <li><a class="dropdown-item" data-action="user-initialize" href="{{ url_for('.initialize_account', user_id=user.id) }}">{{ render_icon('enabled') }} Initialisieren</a></li>

M byceps/blueprints/admin/user/templates/admin/user/index.html => byceps/blueprints/admin/user/templates/admin/user/index.html +1 -1
@@ 14,7 14,7 @@
    <div class="column-auto">
      <h1>{{ title }}</h1>
    </div>
    {%- if g.current_user.has_permission(UserPermission.create) %}
    {%- if g.user.has_permission(UserPermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_account_form') }}">{{ render_icon('add') }} <span>Benutzer erstellen</span></a>

M byceps/blueprints/admin/user/templates/admin/user/manage_roles.html => byceps/blueprints/admin/user/templates/admin/user/manage_roles.html +1 -1
@@ 50,7 50,7 @@
          {%- endif %}
        </td>
        <td>
          {%- if g.current_user.has_permission(RolePermission.assign) %}
          {%- if g.user.has_permission(RolePermission.assign) %}
            {%- if user_has_role %}
          <a class="button button--compact" data-action="role-deassign" href="{{ url_for('.role_deassign', user_id=user.id, role_id=role.id) }}" title="Rolle entfernen">{{ render_icon('remove') }}</a>
            {%- else %}

M byceps/blueprints/admin/user/templates/admin/user/view.html => byceps/blueprints/admin/user/templates/admin/user/view.html +1 -1
@@ 114,7 114,7 @@
      <div class="radio-panel" id="tabs-panel-badges">
        <h2>Abzeichen {{ render_extra_in_heading(badges_with_awarding_quantity|length) }}</h2>

        {%- if g.current_user.has_permission(UserBadgePermission.award) %}
        {%- if g.user.has_permission(UserBadgePermission.award) %}
        <div class="button-row button-row--right">
          <a class="button" href="{{ url_for('user_badge_admin.award_form', user_id=user.id) }}">{{ render_icon('add') }} <span>Verleihen</span></a>
        </div>

M byceps/blueprints/admin/user/templates/admin/user/view_permissions.html => byceps/blueprints/admin/user/templates/admin/user/view_permissions.html +1 -1
@@ 19,7 19,7 @@

{% block body %}

  {%- if g.current_user.has_permission(RolePermission.assign) %}
  {%- if g.user.has_permission(RolePermission.assign) %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.manage_roles', user_id=user.id) }}">{{ render_icon('permission') }} <span>Rollen verwalten</span></a>
  </div>

M byceps/blueprints/admin/user/views.py => byceps/blueprints/admin/user/views.py +10 -10
@@ 188,7 188,7 @@ def create_account():
        )
        return create_account_form(form)

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    try:
        user, event = user_creation_service.create_basic_user(


@@ 248,7 248,7 @@ def set_password(user_id):
        return set_password_form(user.id, form)

    new_password = form.password.data
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    password_service.update_password_hash(user.id, new_password, initiator_id)



@@ 267,7 267,7 @@ def initialize_account(user_id):
    """Initialize the user account."""
    user = _get_user_or_404(user_id)

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    user_command_service.initialize_account(user.id, initiator_id=initiator_id)



@@ 313,7 313,7 @@ def suspend_account(user_id):
    if not form.validate():
        return suspend_account_form(user.id, form)

    initiator_id = g.current_user.id
    initiator_id = g.user.id
    reason = form.reason.data.strip()

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


@@ 361,7 361,7 @@ def unsuspend_account(user_id):
    if not form.validate():
        return unsuspend_account_form(user.id, form)

    initiator_id = g.current_user.id
    initiator_id = g.user.id
    reason = form.reason.data.strip()

    event = user_command_service.unsuspend_account(


@@ 413,7 413,7 @@ def delete_account(user_id):
    if not form.validate():
        return delete_account_form(user.id, form)

    initiator_id = g.current_user.id
    initiator_id = g.user.id
    reason = form.reason.data.strip()

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


@@ 451,7 451,7 @@ def change_email_address(user_id):

    old_email_address = user.email_address
    new_email_address = form.email_address.data.strip()
    initiator_id = g.current_user.id
    initiator_id = g.user.id
    reason = form.reason.data.strip()

    event = user_command_service.change_email_address(


@@ 494,7 494,7 @@ def change_screen_name(user_id):

    old_screen_name = user.screen_name
    new_screen_name = form.screen_name.data.strip()
    initiator_id = g.current_user.id
    initiator_id = g.user.id
    reason = form.reason.data.strip()

    event = user_command_service.change_screen_name(


@@ 554,7 554,7 @@ def role_assign(user_id, role_id):
    """Assign the role to the user."""
    user = _get_user_or_404(user_id)
    role = _get_role_or_404(role_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    authorization_service.assign_role_to_user(
        role.id, user.id, initiator_id=initiator_id


@@ 572,7 572,7 @@ def role_deassign(user_id, role_id):
    """Deassign the role from the user."""
    user = _get_user_or_404(user_id)
    role = _get_role_or_404(role_id)
    initiator_id = g.current_user.id
    initiator_id = g.user.id

    authorization_service.deassign_role_from_user(
        role.id, user.id, initiator_id=initiator_id

M byceps/blueprints/admin/user_badge/templates/admin/user_badge/index.html => byceps/blueprints/admin/user_badge/templates/admin/user_badge/index.html +1 -1
@@ 20,7 20,7 @@
    <div class="column-auto">
      <h1>Abzeichen {{ render_extra_in_heading(badges|length) }}</h1>
    </div>
  {%- if g.current_user.has_permission(UserBadgePermission.create) %}
  {%- if g.user.has_permission(UserBadgePermission.create) %}
    <div class="column-auto">
      <div class="button-row button-row--right">
        <a class="button" href="{{ url_for('.create_form') }}">{{ render_icon('add') }} <span>Abzeichen erstellen</span></a>

M byceps/blueprints/admin/user_badge/templates/admin/user_badge/view.html => byceps/blueprints/admin/user_badge/templates/admin/user_badge/view.html +1 -1
@@ 40,7 40,7 @@
  </nav>
  <h1>{{ badge.label }}</h1>

  {%- if g.current_user.has_permission(UserBadgePermission.update) %}
  {%- if g.user.has_permission(UserBadgePermission.update) %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.update_form', badge_id=badge.id) }}">{{ render_icon('edit') }} <span>Bearbeiten</span></a>
  </div>

M byceps/blueprints/admin/user_badge/views.py => byceps/blueprints/admin/user_badge/views.py +1 -1
@@ 230,7 230,7 @@ def award(user_id):
    if not badge:
        abort(401, 'Unknown badge ID')

    initiator_id = g.current_user.id
    initiator_id = g.user.id

    _, event = awarding_service.award_badge_to_user(
        badge_id, user_id, initiator_id=initiator_id

M byceps/blueprints/common/authentication/password/forms.py => byceps/blueprints/common/authentication/password/forms.py +1 -1
@@ 49,7 49,7 @@ class UpdateForm(ResetForm):

    @staticmethod
    def validate_old_password(form, field):
        user_id = g.current_user.id
        user_id = g.user.id
        password = field.data

        if not password_service.is_password_valid_for_user(user_id, password):

M byceps/blueprints/common/authentication/password/views.py => byceps/blueprints/common/authentication/password/views.py +1 -1
@@ 200,7 200,7 @@ def _is_verification_token_valid(token: Optional[VerificationToken]) -> bool:


def _get_current_user_or_404():
    user = g.current_user
    user = g.user
    if not user.is_active:
        abort(404)


M byceps/blueprints/common/core/templates/layout/_current_user.html => byceps/blueprints/common/core/templates/layout/_current_user.html +3 -3
@@ 4,17 4,17 @@


<div class="current-user">
  {%- if g.current_user.is_active %}
  {%- if g.user.is_active %}
  <div class="dropdown">
    <a href="{{ url_for('user_settings.view') }}" class="dropdown-toggle">
      {{ render_user_avatar_32(g.current_user) }}
      {{ render_user_avatar_32(g.user) }}
      {{ render_icon('chevron-down') }}
    </a>
    <ol class="dropdown-menu dropdown-menu--right">
      <li>
        <span class="dropdown-label label-and-name">
          <span class="label">Angemeldet als</span>
          <span class="name">{{ render_user_screen_name(g.current_user) }}</span>
          <span class="name">{{ render_user_screen_name(g.user) }}</span>
        </span>
      </li>
      <li class="dropdown-divider"></li>

M byceps/blueprints/common/core/templates/layout/_current_user_menu_items.html => byceps/blueprints/common/core/templates/layout/_current_user_menu_items.html +1 -1
@@ 2,7 2,7 @@


      <li><a class="dropdown-item" href="{{ url_for('dashboard.index') }}">{{ render_icon('dashboard') }} Dashboard</a></li>
      <li><a class="dropdown-item" href="{{ url_for('user_profile.view', user_id=g.current_user.id) }}">{{ render_icon('user-profile') }} Profil</a></li>
      <li><a class="dropdown-item" href="{{ url_for('user_profile.view', user_id=g.user.id) }}">{{ render_icon('user-profile') }} Profil</a></li>
      <li><a class="dropdown-item" href="{{ url_for('user_settings.view') }}">{{ render_icon('user') }} Einstellungen</a></li>
      <li><a class="dropdown-item" href="{{ url_for('ticketing.index_mine') }}">{{ render_icon('ticket') }} Tickets</a></li>
      <li><a class="dropdown-item" href="{{ url_for('shop_orders.index') }}">{{ render_icon('invoice') }} Bestellungen</a></li>

M byceps/blueprints/common/core/views.py => byceps/blueprints/common/core/views.py +1 -1
@@ 105,6 105,6 @@ def provide_app_mode():
        required_permissions = {AdminPermission.access}
    else:
        required_permissions = set()
    g.current_user = get_current_user(
    g.user = get_current_user(
        party_id=party_id, required_permissions=required_permissions
    )

M byceps/blueprints/site/authentication/login/views.py => byceps/blueprints/site/authentication/login/views.py +3 -4
@@ 41,10 41,9 @@ blueprint = create_blueprint('authentication.login', __name__)
@templated
def login_form():
    """Show login form."""
    if g.current_user.is_active:
    if g.user.is_active:
        flash_notice(
            f'Du bist bereits als Benutzer "{g.current_user.screen_name}" '
            'angemeldet.'
            f'Du bist bereits als Benutzer "{g.user.screen_name}" angemeldet.'
        )
        return redirect_to('dashboard.index')



@@ 68,7 67,7 @@ def login_form():
@respond_no_content
def login():
    """Allow the user to authenticate with e-mail address and password."""
    if g.current_user.is_active:
    if g.user.is_active:
        return

    if not _is_site_login_enabled():

M byceps/blueprints/site/board/_helpers.py => byceps/blueprints/site/board/_helpers.py +3 -3
@@ 38,7 38,7 @@ def get_category_or_404(category_id):
    if category.board_id != board_id:
        abort(404)

    require_board_access(board_id, g.current_user.id)
    require_board_access(board_id, g.user.id)

    return category



@@ 54,7 54,7 @@ def get_topic_or_404(topic_id):
    if topic.category.board_id != board_id:
        abort(404)

    require_board_access(board_id, g.current_user.id)
    require_board_access(board_id, g.user.id)

    return topic



@@ 70,7 70,7 @@ def get_posting_or_404(posting_id):
    if posting.topic.category.board_id != board_id:
        abort(404)

    require_board_access(board_id, g.current_user.id)
    require_board_access(board_id, g.user.id)

    return posting


M byceps/blueprints/site/board/templates/site/board/_posting_inline_create_form.html => byceps/blueprints/site/board/templates/site/board/_posting_inline_create_form.html +1 -1
@@ 4,7 4,7 @@
  <article class="user-comment">
    <aside class="user-comment-aside">
      <div class="creator">
        {{ render_user_avatar_96(g.current_user) }}
        {{ render_user_avatar_96(g.user) }}
      </div>
    </aside>
    <div class="user-comment-main">

M byceps/blueprints/site/board/templates/site/board/_posting_view_actions.html => byceps/blueprints/site/board/templates/site/board/_posting_view_actions.html +3 -3
@@ 3,9 3,9 @@

{%- set is_initial_topic_posting = posting.is_initial_topic_posting(posting.topic) %}

{%- set user_may_reply = (not topic.locked and g.current_user.has_permission(BoardPostingPermission.create)) %}
{%- set user_may_update = (topic.may_be_updated_by_user(g.current_user) if is_initial_topic_posting else posting.may_be_updated_by_user(g.current_user)) %}
{%- set user_may_hide = g.current_user.has_permission(BoardPermission.hide) %}
{%- set user_may_reply = (not topic.locked and g.user.has_permission(BoardPostingPermission.create)) %}
{%- set user_may_update = (topic.may_be_updated_by_user(g.user) if is_initial_topic_posting else posting.may_be_updated_by_user(g.user)) %}
{%- set user_may_hide = g.user.has_permission(BoardPermission.hide) %}

      {%- if user_may_reply or user_may_update or user_may_hide %}
      <div class="user-comment-actions">

M byceps/blueprints/site/board/templates/site/board/category_view.html => byceps/blueprints/site/board/templates/site/board/category_view.html +2 -2
@@ 56,7 56,7 @@

{{ render_pagination_nav(topics, 'board.category_view', {'slug': category.slug}, centered=True) }}

  {%- set current_user_may_create_topic = g.current_user.has_permission(BoardTopicPermission.create) %}
  {%- set current_user_may_create_topic = g.user.has_permission(BoardTopicPermission.create) %}

  <div class="button-row button-row--right">



@@ 66,7 66,7 @@
    <span class="button button--disabled">{{ render_icon('add') }} <span>Thema hinzufügen</span></span>
    {%- endif %}

    {%- if not g.current_user.is_anonymous %}
    {%- if not g.user.is_anonymous %}
    <button class="button" data-action="mark-all-topics-in-category-as-viewed" href="{{ url_for('.mark_all_topics_in_category_as_viewed', category_id=category.id) }}" title="Alle Themen in dieser Kategorie als gelesen markieren">{{ render_icon('view') }}</button>
    {%- endif %}


M byceps/blueprints/site/board/templates/site/board/posting_update_form.html => byceps/blueprints/site/board/templates/site/board/posting_update_form.html +1 -1
@@ 16,7 16,7 @@
  </nav>
  <h1>{{ render_icon('edit') }} {{ title }}</h1>

  {%- if posting.creator_id != g.current_user.id %}
  {%- if posting.creator_id != g.user.id %}
  {{ render_notification('Du bist im Begriff, einen Beitrag von jemand anderem zu verändern.', category='danger', icon='warning') }}
  {%- endif %}


M byceps/blueprints/site/board/templates/site/board/topic_moderate_form.html => byceps/blueprints/site/board/templates/site/board/topic_moderate_form.html +5 -5
@@ 18,7 18,7 @@

  <p>Thema &quot;{{ topic.title }}&quot; von {{ render_user_link(topic.creator) }}</p>

  {%- if g.current_user.has_permission(BoardPermission.hide) %}
  {%- if g.user.has_permission(BoardPermission.hide) %}
  <h2>{{ render_icon('view') }} Sichtbarkeit</h2>
  <p>Das Thema ist {% if topic.hidden %}<strong>versteckt</strong> ({{ render_datetime(topic.hidden_at|utc_to_local_tz) }} durch {{ render_user_screen_name(topic.hidden_by) }}){% else %}<strong>sichtbar</strong>{% endif %}.</p>
  <div class="button-row">


@@ 32,7 32,7 @@
  </div>
  {%- endif %}

  {%- if g.current_user.has_permission(BoardTopicPermission.lock) %}
  {%- if g.user.has_permission(BoardTopicPermission.lock) %}
  <h2>{{ render_icon('lock') }} Schreibsperre</h2>
  <p>Das Thema ist {% if topic.locked %}<strong>geschlossen</strong> ({{ render_datetime(topic.locked_at|utc_to_local_tz) }} durch {{ render_user_screen_name(topic.locked_by) }}){% else %}<strong>offen</strong>{% endif %}.</p>
  <div class="button-row">


@@ 46,7 46,7 @@
  </div>
  {%- endif %}

  {%- if g.current_user.has_permission(BoardTopicPermission.pin) %}
  {%- if g.user.has_permission(BoardTopicPermission.pin) %}
  <h2>{{ render_icon('pin') }} Anheften</h2>
  <p>Das Thema ist {% if topic.pinned %}<strong>angepinnt</strong> ({{ render_datetime(topic.pinned_at|utc_to_local_tz) }} durch {{ render_user_screen_name(topic.pinned_by) }}){% else %}<strong>nicht angepinnt</strong>{% endif %}.</p>
  <div class="button-row">


@@ 60,7 60,7 @@
  </div>
  {%- endif %}

  {%- if g.current_user.has_permission(BoardTopicPermission.move) %}
  {%- if g.user.has_permission(BoardTopicPermission.move) %}
  <h2>{{ render_icon('move') }} Verschieben</h2>
  <p>Das Thema befindet sich in der Kategorie &quot;{{ topic.category.title }}&quot;.</p>
    {%- if categories %}


@@ 82,7 82,7 @@
    {%- endif %}
  {%- endif %}

  {%- if g.current_user.has_permission(BoardPermission.announce) %}
  {%- if g.user.has_permission(BoardPermission.announce) %}
  <h2>{{ render_icon('announce') }} Ankündigungen</h2>
  <p>Das Thema ist {% if not topic.posting_limited_to_moderators %}<strong>nicht</strong> {% endif %} auf Ankündigungen durch Moderatoren beschränkt.</p>
  <div class="button-row">

M byceps/blueprints/site/board/templates/site/board/topic_update_form.html => byceps/blueprints/site/board/templates/site/board/topic_update_form.html +1 -1
@@ 16,7 16,7 @@
  </nav>
  <h1>{{ render_icon('edit') }} {{ title }}</h1>

  {%- if topic.creator_id != g.current_user.id %}
  {%- if topic.creator_id != g.user.id %}
  {{ render_notification('Du bist im Begriff, ein Thema von jemand anderem zu verändern.', category='danger', icon='warning') }}
  {%- endif %}


M byceps/blueprints/site/board/templates/site/board/topic_view.html => byceps/blueprints/site/board/templates/site/board/topic_view.html +3 -3
@@ 26,7 26,7 @@
  </div>
{%- endif %}

  {%- if g.current_user.has_any_permission(BoardPermission.hide, BoardTopicPermission.lock, BoardTopicPermission.move, BoardTopicPermission.pin) %}
  {%- if g.user.has_any_permission(BoardPermission.hide, BoardTopicPermission.lock, BoardTopicPermission.move, BoardTopicPermission.pin) %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.topic_moderate_form', topic_id=topic.id) }}" title="Thema moderieren">{{ render_icon('moderate') }} <span>Moderieren</span></a>
  </div>


@@ 56,13 56,13 @@

  </div>

  {%- set current_user_may_reply_generally = g.current_user.has_permission(BoardPostingPermission.create) %}
  {%- set current_user_may_reply_generally = g.user.has_permission(BoardPostingPermission.create) %}

  {%- if not current_user_may_reply_generally %}
  <small>
    <p style="text-align: right;">Du musst <a href="{{ url_for('authentication.login.login_form') }}">angemeldet</a> sein, um antworten zu können.</p>
  </small>
  {%- elif topic.locked or (topic.posting_limited_to_moderators and not g.current_user.has_permission(BoardPermission.announce)) %}
  {%- elif topic.locked or (topic.posting_limited_to_moderators and not g.user.has_permission(BoardPermission.announce)) %}
  <div class="button-row button-row--right">
    <span class="button button--disabled">{{ render_icon('reply') }} <span>Antworten</span></span>
  </div>

M byceps/blueprints/site/board/views_category.py => byceps/blueprints/site/board/views_category.py +3 -3
@@ 26,7 26,7 @@ from . import _helpers as h, service
def category_index():
    """List categories."""
    board_id = h.get_board_id()
    user = g.current_user
    user = g.user

    h.require_board_access(board_id, user.id)



@@ 49,7 49,7 @@ def category_index():
def category_view(slug, page):
    """List latest topics in the category."""
    board_id = h.get_board_id()
    user = g.current_user
    user = g.user

    h.require_board_access(board_id, user.id)



@@ 91,7 91,7 @@ def mark_all_topics_in_category_as_viewed(category_id):
    category = h.get_category_or_404(category_id)

    board_last_view_service.mark_all_topics_in_category_as_viewed(
        category_id, g.current_user.id
        category_id, g.user.id
    )

    flash_success(

M byceps/blueprints/site/board/views_posting.py => byceps/blueprints/site/board/views_posting.py +14 -14
@@ 35,7 35,7 @@ def posting_view(posting_id):
    """
    posting = h.get_posting_or_404(posting_id)

    page = service.calculate_posting_page_number(posting, g.current_user)
    page = service.calculate_posting_page_number(posting, g.user)

    return redirect(
        h.build_url_for_posting_in_topic_view(posting, page, _external=True)


@@ 87,7 87,7 @@ def posting_create(topic_id):
    if not form.validate():
        return posting_create_form(topic_id, form)

    creator = g.current_user
    creator = g.user
    body = form.body.data.strip()

    if topic.locked:


@@ 100,7 100,7 @@ def posting_create(topic_id):

    if (
        topic.posting_limited_to_moderators
        and not g.current_user.has_permission(BoardPermission.announce)
        and not g.user.has_permission(BoardPermission.announce)
    ):
        flash_error(
            'In diesem Thema dürfen nur Moderatoren Beiträge hinzufügen.',


@@ 112,9 112,9 @@ def posting_create(topic_id):
        topic.id, creator.id, body
    )

    if not g.current_user.is_anonymous:
    if not g.user.is_anonymous:
        board_last_view_service.mark_category_as_just_viewed(
            topic.category.id, g.current_user.id
            topic.category.id, g.user.id
        )

    flash_success('Deine Antwort wurde hinzugefügt.')


@@ 137,10 137,10 @@ def posting_update_form(posting_id, erroneous_form=None):
    """Show form to update a posting."""
    posting = h.get_posting_or_404(posting_id)

    page = service.calculate_posting_page_number(posting, g.current_user)
    page = service.calculate_posting_page_number(posting, g.user)
    url = h.build_url_for_posting_in_topic_view(posting, page)

    user_may_update = posting.may_be_updated_by_user(g.current_user)
    user_may_update = posting.may_be_updated_by_user(g.user)

    if posting.topic.locked and not user_may_update:
        flash_error(


@@ 172,10 172,10 @@ def posting_update(posting_id):
    """Update a posting."""
    posting = h.get_posting_or_404(posting_id)

    page = service.calculate_posting_page_number(posting, g.current_user)
    page = service.calculate_posting_page_number(posting, g.user)
    url = h.build_url_for_posting_in_topic_view(posting, page)

    user_may_update = posting.may_be_updated_by_user(g.current_user)
    user_may_update = posting.may_be_updated_by_user(g.user)

    if posting.topic.locked and not user_may_update:
        flash_error(


@@ 197,7 197,7 @@ def posting_update(posting_id):
        return posting_update_form(posting_id, form)

    event = board_posting_command_service.update_posting(
        posting.id, g.current_user.id, form.body.data
        posting.id, g.user.id, form.body.data
    )

    flash_success('Der Beitrag wurde aktualisiert.')


@@ 230,11 230,11 @@ def posting_moderate_form(posting_id):
def posting_hide(posting_id):
    """Hide a posting."""
    posting = h.get_posting_or_404(posting_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_posting_command_service.hide_posting(posting.id, moderator_id)

    page = service.calculate_posting_page_number(posting, g.current_user)
    page = service.calculate_posting_page_number(posting, g.user)

    flash_success('Der Beitrag wurde versteckt.', icon='hidden')



@@ 252,13 252,13 @@ def posting_hide(posting_id):
def posting_unhide(posting_id):
    """Un-hide a posting."""
    posting = h.get_posting_or_404(posting_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_posting_command_service.unhide_posting(
        posting.id, moderator_id
    )

    page = service.calculate_posting_page_number(posting, g.current_user)
    page = service.calculate_posting_page_number(posting, g.user)

    flash_success('Der Beitrag wurde wieder sichtbar gemacht.', icon='view')


M byceps/blueprints/site/board/views_topic.py => byceps/blueprints/site/board/views_topic.py +14 -16
@@ 36,7 36,7 @@ from . import _helpers as h, service
def topic_index(page):
    """List latest topics in all categories."""
    board_id = h.get_board_id()
    user = g.current_user
    user = g.user

    h.require_board_access(board_id, user.id)



@@ 59,7 59,7 @@ def topic_index(page):
@templated
def topic_view(topic_id, page):
    """List postings for the topic."""
    user = g.current_user
    user = g.user

    topic = board_topic_query_service.find_topic_visible_for_user(
        topic_id, user


@@ 90,9 90,7 @@ def topic_view(topic_id, page):
        if posting is None:
            page = 1
        else:
            page = service.calculate_posting_page_number(
                posting, g.current_user
            )
            page = service.calculate_posting_page_number(posting, g.user)
            # Jump to a specific posting. This requires a redirect.
            url = h.build_url_for_posting_in_topic_view(posting, page)
            return redirect(url, code=307)


@@ 153,7 151,7 @@ def topic_create(category_id):
    if not form.validate():
        return topic_create_form(category.id, form)

    creator = g.current_user
    creator = g.user
    title = form.title.data.strip()
    body = form.body.data.strip()



@@ 178,7 176,7 @@ def topic_update_form(topic_id, erroneous_form=None):
    topic = h.get_topic_or_404(topic_id)
    url = h.build_url_for_topic(topic.id)

    user_may_update = topic.may_be_updated_by_user(g.current_user)
    user_may_update = topic.may_be_updated_by_user(g.user)

    if topic.locked and not user_may_update:
        flash_error(


@@ 214,7 212,7 @@ def topic_update(topic_id):
    topic = h.get_topic_or_404(topic_id)
    url = h.build_url_for_topic(topic.id)

    user_may_update = topic.may_be_updated_by_user(g.current_user)
    user_may_update = topic.may_be_updated_by_user(g.user)

    if topic.locked and not user_may_update:
        flash_error(


@@ 235,7 233,7 @@ def topic_update(topic_id):
        return topic_update_form(topic_id, form)

    board_topic_command_service.update_topic(
        topic.id, g.current_user.id, form.title.data, form.body.data
        topic.id, g.user.id, form.title.data, form.body.data
    )

    flash_success(f'Das Thema "{topic.title}" wurde aktualisiert.')


@@ 268,7 266,7 @@ def topic_moderate_form(topic_id):
def topic_hide(topic_id):
    """Hide a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.hide_topic(topic.id, moderator_id)



@@ 288,7 286,7 @@ def topic_hide(topic_id):
def topic_unhide(topic_id):
    """Un-hide a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.unhide_topic(topic.id, moderator_id)



@@ 310,7 308,7 @@ def topic_unhide(topic_id):
def topic_lock(topic_id):
    """Lock a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.lock_topic(topic.id, moderator_id)



@@ 330,7 328,7 @@ def topic_lock(topic_id):
def topic_unlock(topic_id):
    """Unlock a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.unlock_topic(topic.id, moderator_id)



@@ 352,7 350,7 @@ def topic_unlock(topic_id):
def topic_pin(topic_id):
    """Pin a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.pin_topic(topic.id, moderator_id)



@@ 372,7 370,7 @@ def topic_pin(topic_id):
def topic_unpin(topic_id):
    """Unpin a topic."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    event = board_topic_command_service.unpin_topic(topic.id, moderator_id)



@@ 391,7 389,7 @@ def topic_unpin(topic_id):
def topic_move(topic_id):
    """Move a topic from one category to another."""
    topic = h.get_topic_or_404(topic_id)
    moderator_id = g.current_user.id
    moderator_id = g.user.id

    new_category_id = request.form.get('category_id')
    if not new_category_id:

M byceps/blueprints/site/dashboard/views.py => byceps/blueprints/site/dashboard/views.py +4 -4
@@ 44,16 44,16 @@ blueprint = create_blueprint('dashboard', __name__)
@templated
def index():
    """Show current user's dashboard."""
    user = user_service.find_active_db_user(g.current_user.id)
    user = user_service.find_active_db_user(g.user.id)
    if user is None:
        abort(404)

    site = site_service.get_site(g.site_id)

    open_orders = _get_open_orders(site, g.current_user.id)
    tickets = _get_tickets(g.current_user)
    open_orders = _get_open_orders(site, g.user.id)
    tickets = _get_tickets(g.user)
    news_headlines = _get_news_headlines(site)
    board_topics = _get_board_topics(site, g.current_user)
    board_topics = _get_board_topics(site, g.user)

    return {
        'open_orders': open_orders,

M byceps/blueprints/site/news/views.py => byceps/blueprints/site/news/views.py +2 -2
@@ 36,7 36,7 @@ def index(page):
    """Show a page of news items."""
    channel_id = _get_channel_id()
    items_per_page = _get_items_per_page_value()
    published_only = not _may_view_drafts(g.current_user)
    published_only = not _may_view_drafts(g.user)

    items = news_item_service.get_aggregated_items_paginated(
        channel_id, page, items_per_page, published_only=published_only


@@ 53,7 53,7 @@ def index(page):
def view(slug):
    """Show a single news item."""
    channel_id = _get_channel_id()
    published_only = not _may_view_drafts(g.current_user)
    published_only = not _may_view_drafts(g.user)

    item = news_item_service.find_aggregated_item_by_slug(
        channel_id, slug, published_only=published_only

M byceps/blueprints/site/newsletter/views.py => byceps/blueprints/site/newsletter/views.py +1 -1
@@ 44,7 44,7 @@ def unsubscribe(list_id):


def _get_current_user_or_404():
    user = g.current_user
    user = g.user

    if not user.is_active:
        abort(404)

M byceps/blueprints/site/seating/templates/site/seating/view_area.html => byceps/blueprints/site/seating/templates/site/seating/view_area.html +1 -1
@@ 28,7 28,7 @@

{%- if seat_management_enabled %}

  {%- if not g.current_user.is_anonymous %}
  {%- if not g.user.is_anonymous %}
    {%- if manage_mode %}
{%- include 'site/seating/_ticket_selector.html' %}
    {%- else %}

M byceps/blueprints/site/seating/views.py => byceps/blueprints/site/seating/views.py +7 -7
@@ 101,16 101,16 @@ def manage_seats_in_area(slug):
    selected_ticket_id = None
    selected_ticket = None

    if _is_seating_admin(g.current_user):
    if _is_seating_admin(g.user):
        selected_ticket = _get_selected_ticket()
        if selected_ticket is not None:
            seat_manager_id = selected_ticket.get_seat_manager().id
            selected_ticket_id = selected_ticket.id
        elif seat_management_enabled:
            seat_manager_id = g.current_user.id
            seat_manager_id = g.user.id

    elif seat_management_enabled:
        seat_manager_id = g.current_user.id
        seat_manager_id = g.user.id

    seats = seat_service.get_seats_with_tickets_for_area(area.id)



@@ 173,7 173,7 @@ def occupy_seat(ticket_id, seat_id):

    ticket = _get_ticket_or_404(ticket_id)

    manager = g.current_user
    manager = g.user

    if not ticket.is_seat_managed_by(manager.id) and not _is_seating_admin(
        manager


@@ 229,7 229,7 @@ def release_seat(ticket_id):
        flash_error(f'Ticket {ticket.code} belegt keinen Sitzplatz.')
        return

    manager = g.current_user
    manager = g.user

    if not ticket.is_seat_managed_by(manager.id) and not _is_seating_admin(
        manager


@@ 255,13 255,13 @@ def release_seat(ticket_id):


def _is_seat_management_enabled():
    if g.current_user.is_anonymous:
    if g.user.is_anonymous:
        return False

    if g.party_id is None:
        return False

    if _is_seating_admin(g.current_user):
    if _is_seating_admin(g.user):
        return True

    party = party_service.get_party(g.party_id)

M byceps/blueprints/site/shop/order/views.py => byceps/blueprints/site/shop/order/views.py +5 -5
@@ 59,11 59,11 @@ def order_form(erroneous_form=None):
        flash_error('Es sind keine Artikel verfügbar.')
        return {'article_compilation': None}

    is_logged_in = g.current_user.is_active
    is_logged_in = g.user.is_active
    if not is_logged_in:
        return list_articles(article_compilation)

    user = user_service.find_user_with_details(g.current_user.id)
    user = user_service.find_user_with_details(g.user.id)

    if erroneous_form:
        form = erroneous_form


@@ 120,7 120,7 @@ def order():
        flash_error('Es wurden keine Artikel ausgewählt.')
        return order_form(form)

    orderer = form.get_orderer(g.current_user.id)
    orderer = form.get_orderer(g.user.id)

    try:
        order = _place_order(storefront.id, orderer, cart)


@@ 143,7 143,7 @@ def order_single_form(article_id, erroneous_form=None):
    storefront = _get_storefront_or_404()
    shop = shop_service.get_shop(storefront.shop_id)

    user = user_service.find_user_with_details(g.current_user.id)
    user = user_service.find_user_with_details(g.user.id)

    form = erroneous_form if erroneous_form else OrderForm(obj=user.detail)



@@ 213,7 213,7 @@ def order_single(article_id):
        article.id, fixed_quantity=quantity
    )

    user = g.current_user
    user = g.user

    if order_service.has_user_placed_orders(user.id, shop.id):
        flash_error('Du kannst keine weitere Bestellung aufgeben.')

M byceps/blueprints/site/shop/orders/views.py => byceps/blueprints/site/shop/orders/views.py +3 -7
@@ 35,15 35,13 @@ def index():
    """List orders placed by the current user in the storefront assigned
    to the current site.
    """
    current_user = g.current_user

    site = site_service.get_site(g.site_id)

    storefront_id = site.storefront_id
    if storefront_id is not None:
        storefront = storefront_service.get_storefront(storefront_id)
        orders = order_service.get_orders_placed_by_user_for_shop(
            current_user.id, storefront.shop_id
            g.user.id, storefront.shop_id
        )
    else:
        orders = []


@@ 61,8 59,6 @@ def view(order_id):
    """Show a single order (if it belongs to the current user and
    current site's storefront).
    """
    current_user = g.current_user

    order = order_service.find_order_with_details(order_id)

    if order is None:


@@ 155,7 151,7 @@ def cancel(order_id):
    reason = form.reason.data.strip()

    try:
        event = order_service.cancel_order(order.id, g.current_user.id, reason)
        event = order_service.cancel_order(order.id, g.user.id, reason)
    except order_service.OrderAlreadyCanceled:
        flash_error(
            'Die Bestellung ist bereits storniert worden; '


@@ 185,4 181,4 @@ def _get_order_by_current_user_or_404(order_id):


def _is_order_placed_by_current_user(order) -> bool:
    return order.placed_by_id == g.current_user.id
    return order.placed_by_id == g.user.id

M byceps/blueprints/site/ticketing/templates/site/ticketing/index_mine.html => byceps/blueprints/site/ticketing/templates/site/ticketing/index_mine.html +7 -7
@@ 42,7 42,7 @@
               user_manager = ticket.get_user_manager()
       %}
    <li>
      <div class="ticket-card{% if ticket.used_by_id == g.current_user.id %} ticket-used-by-me{% endif %}">
      <div class="ticket-card{% if ticket.used_by_id == g.user.id %} ticket-used-by-me{% endif %}">

        {# icon, code #}
        <div class="ticket-card-cell">


@@ 96,13 96,13 @@
            <div class="label-row">
              <span class="label">Nutzer/in</span>

              {%- if ticket_management_enabled and (user_manager == g.current_user) and not ticket.user_checked_in %}
              {%- if ticket_management_enabled and (user_manager == g.user) and not ticket.user_checked_in %}
              <span class="label-buttons">
                <div class="dropdown">
                  <button class="dropdown-toggle button button--outline button--compact">{{ render_icon('chevron-down') -}}</button>
                  <ol class="dropdown-menu dropdown-menu--right">
                    <li><a class="dropdown-item" href="{{ url_for('.appoint_user_form', ticket_id=ticket.id) }}">{{ render_icon('arrow-right') }} Nutzer/in zuweisen</a></li>
                    {%- if ticket.used_by_id != g.current_user.id %}
                    {%- if ticket.used_by_id != g.user.id %}
                    <li><a class="dropdown-item" href="{{ url_for('.withdraw_user', ticket_id=ticket.id, _method='DELETE') }}" data-action="withdraw-user">{{ render_icon('arrow-left') }} selbst nutzen</a></li>
                    {%- endif %}
                  </ol>


@@ 126,13 126,13 @@
            <div class="label-row">
              <span class="label">Verwalter/in</span>

              {%- if ticket_management_enabled and (ticket.owned_by_id == g.current_user.id) and not ticket.user_checked_in %}
              {%- if ticket_management_enabled and (ticket.owned_by_id == g.user.id) and not ticket.user_checked_in %}
              <span class="label-buttons">
                <div class="dropdown">
                  <button class="dropdown-toggle button button--outline button--compact">{{ render_icon('chevron-down') -}}</button>
                  <ol class="dropdown-menu dropdown-menu--right">
                    <li><a class="dropdown-item" href="{{ url_for('.appoint_user_manager_form', ticket_id=ticket.id) }}">{{ render_icon('arrow-right') }} Nutzer-Verwaltung übertragen</a></li>
                    {%- if user_manager != g.current_user %}
                    {%- if user_manager != g.user %}
                    <li><a class="dropdown-item" href="{{ url_for('.withdraw_user_manager', ticket_id=ticket.id, _method='DELETE') }}" data-action="withdraw-user-manager">{{ render_icon('arrow-left') }} Nutzer-Verwaltung zurückholen</a></li>
                    {%- endif %}
                  </ol>


@@ 167,13 167,13 @@
            <div class="label-row">
              <span class="label">Verwalter/in</span>

              {%- if ticket.owned_by_id == g.current_user.id %}
              {%- if ticket.owned_by_id == g.user.id %}
              <span class="label-buttons">
                <div class="dropdown">
                  <button class="dropdown-toggle button button--outline button--compact">{{ render_icon('chevron-down') -}}</button>
                  <ol class="dropdown-menu dropdown-menu--right">
                    <li><a class="dropdown-item" href="{{ url_for('.appoint_seat_manager_form', ticket_id=ticket.id) }}">{{ render_icon('arrow-right') }} Sitzplatz-Verwaltung übertragen</a></li>
                    {%- if seat_manager != g.current_user %}
                    {%- if seat_manager != g.user %}
                    <li><a class="dropdown-item" href="{{ url_for('.withdraw_seat_manager', ticket_id=ticket.id, _method='DELETE') }}" data-action="withdraw-seat-manager">{{ render_icon('arrow-left') }} Sitzplatz-Verwaltung zurückholen</a></li>
                    {%- endif %}
                  </ol>

M byceps/blueprints/site/ticketing/views.py => byceps/blueprints/site/ticketing/views.py +14 -14
@@ 40,16 40,16 @@ def index_mine():

    party = party_service.get_party(g.party_id)

    current_user = g.current_user
    user = g.user

    tickets = ticket_service.find_tickets_related_to_user_for_party(
        current_user.id, party.id
        user.id, party.id
    )

    tickets = [ticket for ticket in tickets if not ticket.revoked]

    current_user_uses_any_ticket = find(
        tickets, lambda t: t.used_by_id == current_user.id
        tickets, lambda t: t.used_by_id == user.id
    )

    return {


@@ 68,7 68,7 @@ def view_printable_html(ticket_id):
    """Show a form to select a user to appoint for the ticket."""
    ticket = _get_ticket_or_404(ticket_id)

    if not _is_user_allowed_to_print_ticket(ticket, g.current_user.id):
    if not _is_user_allowed_to_print_ticket(ticket, g.user.id):
        # Hide ticket ID validity rather than openly denying access.
        abort(404)



@@ 114,7 114,7 @@ def appoint_user_form(ticket_id, erroneous_form=None):

    _abort_if_ticket_user_checked_in(ticket)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_user_managed_by(manager.id):
        abort(403)


@@ 140,7 140,7 @@ def appoint_user(ticket_id):
    if not form.validate():
        return appoint_user_form(ticket_id, form)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_user_managed_by(manager.id):
        abort(403)


@@ 169,7 169,7 @@ def withdraw_user(ticket_id):

    _abort_if_ticket_user_checked_in(ticket)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_user_managed_by(manager.id):
        abort(403)


@@ 198,7 198,7 @@ def appoint_user_manager_form(ticket_id, erroneous_form=None):

    _abort_if_ticket_user_checked_in(ticket)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 224,7 224,7 @@ def appoint_user_manager(ticket_id):
    if not form.validate():
        return appoint_user_manager_form(ticket_id, form)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 255,7 255,7 @@ def withdraw_user_manager(ticket_id):

    _abort_if_ticket_user_checked_in(ticket)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 284,7 284,7 @@ def appoint_seat_manager_form(ticket_id, erroneous_form=None):

    ticket = _get_ticket_or_404(ticket_id)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 308,7 308,7 @@ def appoint_seat_manager(ticket_id):

    ticket = _get_ticket_or_404(ticket_id)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 337,7 337,7 @@ def withdraw_seat_manager(ticket_id):

    ticket = _get_ticket_or_404(ticket_id)

    manager = g.current_user.to_dto()
    manager = g.user.to_dto()

    if not ticket.is_owned_by(manager.id):
        abort(403)


@@ 363,7 363,7 @@ def _abort_if_ticket_management_disabled():


def _is_ticket_management_enabled():
    if g.current_user.is_anonymous:
    if g.user.is_anonymous:
        return False

    if g.party_id is None:

M byceps/blueprints/site/user/avatar/views.py => byceps/blueprints/site/user/avatar/views.py +1 -1
@@ 107,7 107,7 @@ def delete():


def _get_current_user_or_404():
    user = g.current_user
    user = g.user

    if not user.is_active:
        abort(404)

M byceps/blueprints/site/user/current/views.py => byceps/blueprints/site/user/current/views.py +1 -1
@@ 18,7 18,7 @@ blueprint = create_blueprint('user_current', __name__)
@blueprint.route('/me.json')
def view_as_json():
    """Show selected attributes of the current user's profile as JSON."""
    user = g.current_user
    user = g.user

    if not user.is_active:
        # Return empty response.

M byceps/blueprints/site/user/settings/forms.py => byceps/blueprints/site/user/settings/forms.py +2 -2
@@ 29,7 29,7 @@ class ChangeScreenNameForm(LocalizedForm):

    @staticmethod
    def validate_screen_name(form, field):
        if g.current_user.screen_name == field.data:
        if g.user.screen_name == field.data:
            raise ValueError('Dies ist bereits der aktuelle Benutzername.')

        if user_service.is_screen_name_already_assigned(field.data):


@@ 37,7 37,7 @@ class ChangeScreenNameForm(LocalizedForm):

    @staticmethod
    def validate_password(form, field):
        user_id = g.current_user.id
        user_id = g.user.id
        password = field.data

        if not password_service.is_password_valid_for_user(user_id, password):

M byceps/blueprints/site/user/settings/views.py => byceps/blueprints/site/user/settings/views.py +2 -4
@@ 34,9 34,7 @@ blueprint = create_blueprint('user_settings', __name__)
@templated
def view():
    """Show the current user's internal profile."""
    current_user = g.current_user

    user = user_service.find_active_db_user(current_user.id)
    user = user_service.find_active_db_user(g.user.id)
    if user is None:
        abort(404)



@@ 153,7 151,7 @@ def details_update():


def _get_current_user_or_404():
    user = g.current_user
    user = g.user
    if not user.is_active:
        abort(404)


M byceps/blueprints/site/user_group/templates/site/user_group/index.html => byceps/blueprints/site/user_group/templates/site/user_group/index.html +1 -1
@@ 34,7 34,7 @@
    </tbody>
  </table>

  {%- if g.current_user.is_active %}
  {%- if g.user.is_active %}
  <div class="button-row">
    <a class="button" href="{{ url_for('.create_form') }}">{{ render_icon('add') }} <span>Gruppe erstellen</span></a>
  </div>

M byceps/blueprints/site/user_group/views.py => byceps/blueprints/site/user_group/views.py +3 -3
@@ 35,7 35,7 @@ def index():
@templated
def create_form(erroneous_form=None):
    """Show a form to create a group."""
    if not g.current_user.is_active:
    if not g.user.is_active:
        flash_error(
            'Du musst angemeldet sein, um eine Benutzergruppe erstellen zu können.'
        )


@@ 51,7 51,7 @@ def create_form(erroneous_form=None):
@blueprint.route('/', methods=['POST'])
def create():
    """Create a group."""
    if not g.current_user.is_active:
    if not g.user.is_active:
        flash_error(
            'Du musst angemeldet sein, um eine Benutzergruppe erstellen zu können.'
        )


@@ 59,7 59,7 @@ def create():

    form = CreateForm(request.form)

    creator = g.current_user
    creator = g.user
    title = form.title.data.strip()
    description = form.description.data.strip()


M byceps/blueprints/site/user_message/views.py => byceps/blueprints/site/user_message/views.py +1 -1
@@ 48,7 48,7 @@ def create(recipient_id):
    if not form.validate():
        return create_form(recipient.id, form)

    sender = g.current_user
    sender = g.user
    body = form.body.data.strip()
    sender_contact_url = url_for(
        '.create_form', recipient_id=sender.id, _external=True

M byceps/util/views.py => byceps/util/views.py +2 -2
@@ 28,7 28,7 @@ def login_required(func):

    @wraps(func)
    def wrapper(*args, **kwargs):
        if not g.current_user.is_active:
        if not g.user.is_active:
            flash_notice('Bitte melde dich an.')
            return redirect_to('authentication.login.login_form')
        return func(*args, **kwargs)


@@ 42,7 42,7 @@ def permission_required(permission):
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            if not g.current_user.has_permission(permission):
            if not g.user.has_permission(permission):
                abort(403)
            return func(*args, **kwargs)


M tests/helpers.py => tests/helpers.py +1 -1
@@ 69,7 69,7 @@ def current_party_set(app, party):
@contextmanager
def current_user_set(app, user):
    def handler(sender, **kwargs):
        g.current_user = user
        g.user = user

    with appcontext_pushed.connected_to(handler, app):
        yield