#NEWLINE# @ secure_required #NEWLINE# def activate_retry( request , activation_key , template_name = 'userena/activate_retry_success.html' , extra_context = None ) : #NEWLINE# #INDENT# '\n    Reissue a new ``activation_key`` for the user with the expired\n    ``activation_key``.\n\n    If ``activation_key`` does not exists, or ``USERENA_ACTIVATION_RETRY`` is\n    set to False and for any other error condition user is redirected to\n    :func:`activate` for error message display.\n\n    :param activation_key:\n        String of a SHA1 string of 40 characters long. A SHA1 is always 160bit\n        long, with 4 bits per character this makes it --160/4-- 40 characters\n        long.\n\n    :param template_name:\n        String containing the template name that is used when new\n        ``activation_key`` has been created. Defaults to\n        ``userena/activate_retry_success.html``.\n\n    :param extra_context:\n        Dictionary containing variables which could be added to the template\n        context. Default to an empty dictionary.\n\n    ' #NEWLINE# if ( not userena_settings . USERENA_ACTIVATION_RETRY ) : #NEWLINE# #INDENT# return redirect ( reverse ( 'userena_activate' , args = ( activation_key , ) ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if UserenaSignup . objects . check_expired_activation ( activation_key ) : #NEWLINE# #INDENT# new_key = UserenaSignup . objects . reissue_activation ( template_name ) #NEWLINE# if new_key : #NEWLINE# #INDENT# if ( not extra_context ) : #NEWLINE# #INDENT# extra_context = dict ( ) #NEWLINE# #UNINDENT# return ExtraContextTemplateView . as_view ( template_name = template_name , extra_context = extra_context ) ( request ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return redirect ( reverse ( 'userena_activate' , args = ( activation_key , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return redirect ( reverse ( 'userena_activate' , args = ( activation_key , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except UserenaSignup . DoesNotExist : #NEWLINE# #INDENT# return redirect ( reverse ( 'userena_activate' , args = ( activation_key , ) ) )