def METHOD_NAME(identity):
    """Check that this identity is detained with a detention profile"""
    try:
        return DetentionProfile.objects.get(justification=identity.justification)
    except DetentionProfile.DoesNotExist:
        return None