diff --git a/src/Vervis/Handler/Ticket.hs b/src/Vervis/Handler/Ticket.hs index 1045a13..0eada40 100644 --- a/src/Vervis/Handler/Ticket.hs +++ b/src/Vervis/Handler/Ticket.hs @@ -287,7 +287,7 @@ getProjectTicketR shar proj ltkhid = do ) author' <- case author of - Left (Entity _ tal) -> Left <$> do + Left (Entity _ tal, _) -> Left <$> do p <- getJust $ ticketAuthorLocalAuthor tal getJust $ personIdent p Right (Entity _ tar) -> Right <$> do diff --git a/src/Vervis/Ticket.hs b/src/Vervis/Ticket.hs index 6b30d7f..910aa05 100644 --- a/src/Vervis/Ticket.hs +++ b/src/Vervis/Ticket.hs @@ -497,7 +497,9 @@ getProjectTicket , Entity Ticket , Entity LocalTicket , Entity TicketProjectLocal - , Either (Entity TicketAuthorLocal) (Entity TicketAuthorRemote) + , Either + (Entity TicketAuthorLocal, Entity TicketUnderProject) + (Entity TicketAuthorRemote) ) ) getProjectTicket shr prj ltid = runMaybeT $ do @@ -513,10 +515,10 @@ getProjectTicket shr prj ltid = runMaybeT $ do (do mtal <- lift $ getBy $ UniqueTicketAuthorLocal ltid for mtal $ \ tal@(Entity talid _) -> do tupid1 <- MaybeT $ getKeyBy $ UniqueTicketUnderProjectProject tplid - tupid2 <- MaybeT $ getKeyBy $ UniqueTicketUnderProjectAuthor talid + tup@(Entity tupid2 _) <- MaybeT $ getBy $ UniqueTicketUnderProjectAuthor talid unless (tupid1 == tupid2) $ error "TAL and TPL used by different TUPs!" - return tal + return (tal, tup) ) (lift $ getBy $ UniqueTicketAuthorRemote tplid) "Ticket doesn't have author" @@ -533,7 +535,9 @@ getProjectTicket404 , Entity Ticket , Entity LocalTicket , Entity TicketProjectLocal - , Either (Entity TicketAuthorLocal) (Entity TicketAuthorRemote) + , Either + (Entity TicketAuthorLocal, Entity TicketUnderProject) + (Entity TicketAuthorRemote) ) getProjectTicket404 shr prj ltkhid = do ltid <- decodeKeyHashid404 ltkhid