Permalink
Browse files

Towards #69 - Fixes #69

  • Loading branch information...
1 parent e5a7d81 commit 84ee82c2c773803155148c8105756f1bdb55ac43 @nomadali nomadali committed May 22, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/jeeqs.py
View
@@ -703,12 +703,18 @@ def persist_new_submission():
xg_on = db.create_transaction_options(xg=True)
db.run_in_transaction_options(xg_on, persist_new_submission)
-
# Receive variables from transaction
self.jeeqser = ns.jeeqser
attempt = ns.attempt
jeeqser_challenge = ns.jeeqser_challenge
+ # delete a draft if exists
+ try:
+ draft = Draft.all().ancestor(self.jeeqser).filter('challenge = ', challenge).fetch(1)[0]
+ draft.delete()
+ except IndexError:
+ pass
+
# TODO: Do this asynchronously!
# run the tests and persist the results
if challenge.automatic_review:

0 comments on commit 84ee82c

Please sign in to comment.