~homeworkprod/byceps

f9b7765d8a10731cd0e4f3b0c23c9b5a81ed08ab — Jochen Kupperschmidt a month ago b309c8b
Remove global orga count from global admin dashboard and service
M byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html => byceps/blueprints/admin/dashboard/templates/admin/dashboard/view_global.html +0 -1
@@ 23,7 23,6 @@
{%- include 'admin/dashboard/_brands.html' %}
    {%- endcall %}
    {{ render_bigstats_cell(party_count, 'Partys', href=url_for('party_admin.index'), icon_name='date') }}
    {{ render_bigstats_cell(orga_count, 'Organisatoren', icon_name='users') }}
    {{ render_bigstats_cell(user_count|separate_thousands, 'Benutzer', href=url_for('user_admin.index'), icon_name='users') }}
    {{ render_bigstats_cell(recent_users_count, 'neue Benutzer in den letzten 7 Tagen', href=url_for('user_admin.index'), icon_name='users', color='#008800') }}
    {{ render_bigstats_cell(uninitialized_user_count, 'noch nicht aktivierte Benutzer', href=url_for('user_admin.index', only='uninitialized'), icon_name='users', color='#1199ff') }}

M byceps/blueprints/admin/dashboard/views.py => byceps/blueprints/admin/dashboard/views.py +0 -4
@@ 68,8 68,6 @@ def view_global():
    brands = brand_service.get_all_brands()
    party_count = party_service.count_parties()

    orga_count = orga_service.count_orgas()

    user_count = user_stats_service.count_users()

    one_week_ago = timedelta(days=7)


@@ 92,8 90,6 @@ def view_global():
        'brands': brands,
        'party_count': party_count,

        'orga_count': orga_count,

        'user_count': user_count,
        'recent_users': recent_users,
        'recent_users_count': recent_users_count,

M byceps/services/orga/service.py => byceps/services/orga/service.py +0 -8
@@ 41,14 41,6 @@ def get_orgas_for_brand(brand_id: BrandID) -> Sequence[DbUser]:
        .all()


def count_orgas() -> int:
    """Return the number of organizers with the organizer flag set."""
    return DbUser.query \
        .distinct(DbUser.id) \
        .join(DbOrgaFlag) \
        .count()


def count_orgas_for_brand(brand_id: BrandID) -> int:
    """Return the number of organizers with the organizer flag set for
    that brand.