<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_redirect_url(self, request):
 """ refreshes token and returns the captive page URL """

        cp = request.GET.get('cp')
        user = request.user
        Token.objects.filter(user=user).delete()
        token = Token.objects.create(user=user)
        return '{0}?username={1}&token={2}'.format(cp, user.username, token.key)