+
+ if not forward:
+ forward = request.session.get('on_signin_url', reverse('index'))
+
+ pending_data = request.session.get('pending_submission_data', None)
+
+ if pending_data and (user.email_isvalid or pending_data['type'] not in settings.REQUIRE_EMAIL_VALIDATION_TO):
+ submission_time = pending_data['time']
+ if submission_time < datetime.datetime.now() - datetime.timedelta(minutes=int(settings.HOLD_PENDING_POSTS_MINUTES)):
+ del request.session['pending_submission_data']
+ 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" % (
+ 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"))
+ ))
+ else:
+ return manage_pending_data(request, _('save'), forward)
+