From c5f138a36c556b8e93e23901caf6b91d1334ae06 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 24 Jun 2015 01:48:06 +0200 Subject: [PATCH] fixed check of used avatars --- Handler/Avatar.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Handler/Avatar.hs b/Handler/Avatar.hs index 7a476a5..ecfa8bc 100644 --- a/Handler/Avatar.hs +++ b/Handler/Avatar.hs @@ -119,7 +119,8 @@ getAvatarDeleteR aId = do case ma of Just _ -> do c <- runDB $ selectList [UserAvatar ==. Just aId] [] - case null c of + d <- runDB $ selectList [BeverageAvatar ==. Just aId] [] + case null c && null d of True -> do runDB $ delete aId setMessageI MsgAvatarDeleted