Skip to content

Commit

Permalink
Fix project usersWithActiveTasks query (#5115)
Browse files Browse the repository at this point in the history
* Fix project usersWithActiveTasks query
* changelog
* Merge branch 'master' into user-email-complex-query
  • Loading branch information
fm3 authored Feb 1, 2021
1 parent 5011801 commit ea49034
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Fixed
- Fixed a bug where the user could delete teams that were still referenced in annotations, projects or task types, thus creating invalid state. [#5108](https://github.com/scalableminds/webknossos/pull/5108/files)
- Fixed a bug where the listing of users that have open tasks of a project failed. [#5115](https://github.com/scalableminds/webknossos/pull/5115)

### Removed
- The isosurface setting was removed. Instead, isosurfaces can be generated via the "Meshes" tab. Also note that the Shift+Click binding for generating an isosurface was removed (for now). Please refer to the "Meshes" tab, too. [#4917](https://github.com/scalableminds/webknossos/pull/4917)
5 changes: 3 additions & 2 deletions app/models/project/Project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,17 @@ class ProjectDAO @Inject()(sqlClient: SQLClient)(implicit ec: ExecutionContext)

def findUsersWithActiveTasks(name: String): Fox[List[(String, String, String, Int)]] =
for {
rSeq <- run(sql"""select u.email, u.firstName, u.lastName, count(a._id)
rSeq <- run(sql"""select m.email, u.firstName, u.lastName, count(a._id)
from
webknossos.annotations_ a
join webknossos.tasks_ t on a._task = t._id
join webknossos.projects_ p on t._project = p._id
join webknossos.users_ u on a._user = u._id
join webknossos.multiusers_ m on u._multiUser = m._id
where p.name = $name
and a.state = '#${AnnotationState.Active.toString}'
and a.typ = '#${AnnotationType.Task}'
group by u.email, u.firstName, u.lastName
group by m.email, u.firstName, u.lastName
""".as[(String, String, String, Int)])
} yield rSeq.toList

Expand Down

0 comments on commit ea49034

Please sign in to comment.