def METHOD_NAME(self, username):
    if not username:
        return None
    if username in self.username_cache:
        return self.username_cache[username]
    try:
        user = User.objects.get(username=username)
    except User.DoesNotExist:
        user = None
    self.username_cache[username] = user
    return user