Skip to content

Commit cfdcb46

Browse files
committed
Fix public space display when not logged in
1 parent 7feba50 commit cfdcb46

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
### Fixed
1414
- Cleaning up after a failed upload should no longer decrement the file + byte counts.
1515
- Fix the broken preview after file deletion within a folder. [#277](https://github.com/clowder-framework/clowder/issues/277)
16+
- Fix public spaces not displaying correctly if not logged in.
1617

1718
### Changed
1819
- Now building mongo-init and monitor docker containers with python 3.8

app/controllers/Spaces.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Spaces @Inject() (spaces: SpaceService, users: UserService, events: EventS
168168
val collectionsInSpace = spaces.getCollectionsInSpace(Some(id.stringify), Some(size))
169169
val datasetsInSpace = datasets.listSpace(size, id.toString(), user)
170170
val spaceBytes : Long = s.spaceBytes
171-
val spaceFiles : Integer = getFilesPerSpace(id, user.get)
171+
val spaceFiles : Integer = getFilesPerSpace(id, user)
172172
val publicDatasetsInSpace = datasets.listSpaceStatus(size, id.toString(), "publicAll", user)
173173
val usersInSpace = spaces.getUsersInSpace(id, None)
174174
var curationObjectsInSpace: List[CurationObject] = List()
@@ -641,9 +641,9 @@ class Spaces @Inject() (spaces: SpaceService, users: UserService, events: EventS
641641
}
642642
}
643643

644-
private def getFilesPerSpace(spaceId: UUID, user: models.User) : Integer = {
644+
private def getFilesPerSpace(spaceId: UUID, user: Option[User]) : Integer = {
645645
var spaceFiles: Integer = 0
646-
val allDatasetsInSpace = datasets.listSpace(0, spaceId.toString(), Some(user))
646+
val allDatasetsInSpace = datasets.listSpace(0, spaceId.toString(), user)
647647
for (ds <- allDatasetsInSpace) {
648648
val files_in_ds = ds.files.length
649649
spaceFiles += files_in_ds

0 commit comments

Comments
 (0)