Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def is_user_in_group(user_id, group_id):
if len(Membership.objects.filter(user__id__exact=user_id, group__id__exact=group_id)) == 1:
return True
else:
return False