<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def activate_retry(request, activation_key, template_name='userena/activate_retry_success.html', extra_context=None):
 """ Reissue a new ``activation_key`` for the user with the expired ``activation_key``. If ``activation_key`` does not exists, or ``USERENA_ACTIVATION_RETRY`` is set to False and for any other error condition user is redirected to :func:`activate` for error message display. :param activation_key: String of a SHA1 string of 40 characters long. A SHA1 is always 160bit long, with 4 bits per character this makes it --160/4-- 40 characters long. :param template_name: String containing the template name that is used when new ``activation_key`` has been created. Defaults to ``userena/activate_retry_success.html``. :param extra_context: Dictionary containing variables which could be added to the template context. Default to an empty dictionary. """

    if not userena_settings.USERENA_ACTIVATION_RETRY:
        return redirect(reverse('userena_activate', args=(activation_key,)))
    try:
        if UserenaSignup.objects.check_expired_activation(activation_key):
            new_key = UserenaSignup.objects.reissue_activation(activation_key)
            if new_key:
                if not extra_context: extra_context = dict()
                return ExtraContextTemplateView.as_view(template_name=template_name,
                                                    extra_context=extra_context)(request)
            else:
                return redirect(reverse('userena_activate',args=(activation_key,)))
        else:
            return redirect(reverse('userena_activate',args=(activation_key,)))
    except UserenaSignup.DoesNotExist:
        return redirect(reverse('userena_activate',args=(activation_key,)))