summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-04-07 14:14:59 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-04-07 14:14:59 +0200
commit241c2aa050b0d1e47e0d72e6e7068a0b8b155c0a (patch)
tree9d3a18f57382a90d2c691996d86d16dc2c7cbd65
parent413e3d0e7f3560360407708fcb5cc881f8208ff8 (diff)
downloadmarks-241c2aa050b0d1e47e0d72e6e7068a0b8b155c0a.tar.gz
marks-241c2aa050b0d1e47e0d72e6e7068a0b8b155c0a.tar.bz2
* Fixup exam deletion
-rw-r--r--main/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/views.py b/main/views.py
index 4dd8f98..1320793 100644
--- a/main/views.py
+++ b/main/views.py
@@ -190,9 +190,11 @@ def delete_exam_view (request, exam):
else:
user_data["exams"].remove (exam)
for name in user_data["ratings"]:
- del user_data["ratings"][name][exam]
+ if exam in user_data["ratings"][name]:
+ del user_data["ratings"][name][exam]
for name in user_data["marks"]:
- del user_data["marks"][name][exam]
+ if exam in user_data["marks"][name]:
+ del user_data["marks"][name][exam]
set_user_data (request, user_data)
return home_view (request)