# -*- coding: utf-8 -*-

from group.models import GroupUserInfo


def is_group_admin(group_id, admin_id):
    return GroupUserInfo.objects.filter(group_id=group_id, user_id=admin_id, admin=True, status=True).exists()


def is_group_subadmin(group_id, admin_id):
    return GroupUserInfo.objects.filter(group_id=group_id, user_id=admin_id, subadmin=True, status=True).exists()
