Fix problem with concurrent posts as reported in #813 by preventing

accidentally submitting a post twice (with Javascript) and modifying the
move-old-files-to-archive code to not move the files away if they
belong to the same submission as the one we're accepting (this
mitigates a concurrent post to at least not end up with a non-existing
draft).
 - Legacy-Id: 4112
This commit is contained in:
Ole Laursen 2012-03-16 17:22:33 +00:00
parent 03980c3882
commit 0bc71c7146
3 changed files with 25 additions and 2 deletions

View file

@ -154,8 +154,9 @@ def perform_postREDESIGN(request, submission):
e.save()
# clean up old files
from ietf.idrfc.expire import move_draft_files_to_archive
move_draft_files_to_archive(draft, prev_rev)
if prev_rev != draft.rev:
from ietf.idrfc.expire import move_draft_files_to_archive
move_draft_files_to_archive(draft, prev_rev)
# automatic state changes
state_change_msg = ""

View file

@ -245,3 +245,14 @@ The IETF is an organized activity of the <a href="http://www.isoc.org">Internet
<br>Please send problem reports to <a href="mailto:ietf-action@ietf.org">ietf-action@ietf.org</a>.
</p>
{% endblock %}
{% block scripts %}
jQuery(function () {
jQuery("form").submit(function() {
if (this.submittedAlready)
return false;
else
this.submittedAlready = true;
});
});
{% endblock %}

View file

@ -13,3 +13,14 @@ Authorization key accepted. Please press the button below to finish Auto-Post of
<input type="submit" value="Auto-Post" />
</form>
{% endblock %}
{% block scripts %}
jQuery(function () {
jQuery("form").submit(function() {
if (this.submittedAlready)
return false;
else
this.submittedAlready = true;
});
});
{% endblock %}