summaryrefslogtreecommitdiff
path: root/src/admin.clj
diff options
context:
space:
mode:
authorScott Ostler <scottbot9000@gmail.com>2011-02-13 01:03:29 -0500
committerScott Ostler <scottbot9000@gmail.com>2011-02-13 01:03:29 -0500
commit6fc29f2c44ac555f8d5ef1ec6a2df3503edcd583 (patch)
treeac5407ba6233701062aa2621c1015002850e020f /src/admin.clj
parent157c865f7486cd4ed684d2bf90c8a03d5b2164b5 (diff)
Fixed buggy assert-update logic
Diffstat (limited to 'src/admin.clj')
-rw-r--r--src/admin.clj18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/admin.clj b/src/admin.clj
index 9dbc65c..3593072 100644
--- a/src/admin.clj
+++ b/src/admin.clj
@@ -130,15 +130,15 @@ AND cancelled = false
(cond (not mute) (resp-error "INVALID_MUTE_ID")
(not active) (resp-error "EXPIRED_MUTE")
(not reason) (resp-error "NO_REASON")
- :else (assert-update
- (do-update :mutes [qry mute-id]
- {:cancelled true
- :cancel_admin_id admin-id
- :cancel_reason reason})
- (do
- (update! *active-mutes*)
- (resp-success "OK"))
- (resp-error "UPDATE_ERROR")))))
+ :else (if (assert-update
+ (do-update :mutes [qry mute-id]
+ {:cancelled true
+ :cancel_admin_id admin-id
+ :cancel_reason reason}))
+ (do
+ (update! *active-mutes*)
+ (resp-success "OK"))
+ (resp-error "UPDATE_ERROR")))))
(defn handle-cancel-mute! [session params]
(if-vip