from django.utils.encoding import smart_unicode
from django.contrib.auth import login, logout
from django.utils.encoding import smart_unicode
from django.contrib.auth import login, logout
return HttpResponseRedirect(reverse('user_authsettings', args=[request.user.id]))
return HttpResponseRedirect(reverse('auth_signin'))
return HttpResponseRedirect(reverse('user_authsettings', args=[request.user.id]))
return HttpResponseRedirect(reverse('auth_signin'))
user_.email_isvalid = request.session.get('auth_validated_email', '') == form1.cleaned_data['email']
user_.set_unusable_password()
user_.email_isvalid = request.session.get('auth_validated_email', '') == form1.cleaned_data['email']
user_.set_unusable_password()
username = user_data.get('username', '')
email = user_data.get('email', '')
username = user_data.get('username', '')
email = user_data.get('email', '')
# We don't care if there are previous cashes in the database... In every case we have to create a new one
hash = ValidationHash.objects.create_new(request.user, 'email', [request.user.email])
# We don't care if there are previous cashes in the database... In every case we have to create a new one
hash = ValidationHash.objects.create_new(request.user, 'email', [request.user.email])
send_template_email([request.user], "auth/mail_validation.html", {
'validation_code': hash,
'additional_get_params' : additional_get_params
})
send_template_email([request.user], "auth/mail_validation.html", {
'validation_code': hash,
'additional_get_params' : additional_get_params
})
if not (request.user.is_superuser or request.user == association.user):
return HttpResponseUnauthorized(request)
if not (request.user.is_superuser or request.user == association.user):
return HttpResponseUnauthorized(request)
if submission_time < datetime.datetime.now() - datetime.timedelta(minutes=int(settings.HOLD_PENDING_POSTS_MINUTES)):
del request.session[PENDING_SUBMISSION_SESSION_ATTR]
elif submission_time < datetime.datetime.now() - datetime.timedelta(minutes=int(settings.WARN_PENDING_POSTS_MINUTES)):
if submission_time < datetime.datetime.now() - datetime.timedelta(minutes=int(settings.HOLD_PENDING_POSTS_MINUTES)):
del request.session[PENDING_SUBMISSION_SESSION_ATTR]
elif submission_time < datetime.datetime.now() - datetime.timedelta(minutes=int(settings.WARN_PENDING_POSTS_MINUTES)):
- user.message_set.create(message=(_("You have a %s pending submission.") % pending_data['data_name']) + " %s, %s, %s" % (
+ messages.info(request, (_("You have a %s pending submission.") % pending_data['data_name']) + " %s, %s, %s" % (
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('save')}), _("save it")),
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('review')}), _("review")),
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('cancel')}), _("cancel"))
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('save')}), _("save it")),
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('review')}), _("review")),
html.hyperlink(reverse('manage_pending_data', kwargs={'action': _('cancel')}), _("cancel"))