def check_total_employee(auth=None, all=None): auth_count = auth or User.get_auth_user_count() all_count = all or User.get_all_users_count() if auth_count > all_count: return jsonify({ "auth_count": auth_count, "all_count": all_count, "msg": "Error! Auth emp count is more than employees" }) elif auth_count < all_count: percent = int((auth_count / all_count) * 100) if percent < 95: return jsonify({ "auth_count": auth_count, "all_count": all_count, "msg": "Percentage of joining is too less" }) else: return jsonify({ "auth_count": auth_count, "all_count": all_count, "msg": "Percentage of joining is OK" }) else: return jsonify({ "auth_count": auth_count, "all_count": all_count, "msg": "All good" })
def get_all_users_count(): allusers = User.get_all_users_count() print(allusers) return jsonify({"count": allusers})