def METHOD_NAME(self, user, code):
    club = Club.objects.get(code=code)
    membership_role = club.membership_set.filter(person=user).first()
    if membership_role is not None:
        return membership_role.role
    return None