def get_context_data(self, **kwargs): context = super(SignupValidateView, self).get_context_data(**kwargs) validated = CustomUser.validate_url(self.kwargs['validate_slug']) login_url = reverse('hosting:login') if validated: message= _("Your account has been activated. You can now ") + '<a href="' + login_url +'">login</a>' section_title=_('Account activation') else: message= _("Sorry. Your request is invalid.") + '<a href="' + login_url +'">login</a>' section_title=_('Account activation') context['message'] = mark_safe(message) context['section_title'] = section_title return context
def get_context_data(self, **kwargs): context = super(SignupValidateView, self).get_context_data(**kwargs) validated = CustomUser.validate_url(self.kwargs['validate_slug']) login_url = reverse('hosting:login') if validated: message = _("Your account has been activated. You can now " ) + '<a href="' + login_url + '">login</a>' section_title = _('Account activation') else: message = _("Sorry. Your request is invalid." ) + '<a href="' + login_url + '">login</a>' section_title = _('Account activation') context['message'] = mark_safe(message) context['section_title'] = section_title return context
def get_context_data(self, **kwargs): context = super(SignupValidateView, self).get_context_data(**kwargs) validated = CustomUser.validate_url(self.kwargs['validate_slug']) login_url = '<a href="' + \ reverse('hosting:login') + '">' + str(_('login')) + '</a>' section_title = _('Account activation') if validated: message = '{account_activation_string} <br /> {login_string} {lurl}.'.format( account_activation_string=_( "Your account has been activated."), login_string=_("You can now"), lurl=login_url) else: home_url = '<a href="' + \ reverse('datacenterlight:index') + '">Data Center Light</a>' message = '{sorry_message} <br />{go_back_to} {hurl}'.format( sorry_message=_("Sorry. Your request is invalid."), go_back_to=_('Go back to'), hurl=home_url) context['message'] = mark_safe(message) context['section_title'] = section_title return context