Skip to content

Commit

Permalink
Fix SoftDelete Visibility being swapped in User Action Log
Browse files Browse the repository at this point in the history
Hard deletes now show "deleted" instead of "null".

Some LoggedAction descriptions were changed.

Signed-off-by: Jadon Fowler <[email protected]>
  • Loading branch information
phase committed Aug 28, 2018
1 parent 435fab0 commit b1ff063
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ final class Application @Inject()(data: DataHelper,
val page = oPage.getOrElse(1)
val offset = (page - 1) * pageSize

val default = LiteralColumn(1) === LiteralColumn(1)
val default = LiteralColumn(true)

val logQuery = queryLog.filter { case (action) =>
(action.userId === userFilter).getOrElse(default) &&
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/project/Projects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class Projects @Inject()(stats: StatTracker,
(Authenticated andThen PermissionAction[AuthRequest](HardRemoveProject)).async { implicit request =>
getProject(author, slug).map { project =>
this.projects.delete(project)
UserActionLogger.log(request, LoggedAction.ProjectVisibilityChange, project.id.getOrElse(-1), "null", project.visibility.nameKey)
UserActionLogger.log(request, LoggedAction.ProjectVisibilityChange, project.id.getOrElse(-1), "deleted", project.visibility.nameKey)
Redirect(ShowHome).withSuccess(request.messages.apply("project.deleted", project.name))
}.merge
}
Expand All @@ -733,7 +733,7 @@ class Projects @Inject()(stats: StatTracker,

this.forums.changeTopicVisibility(data.project, false)

UserActionLogger.log(request.request, LoggedAction.ProjectVisibilityChange, data.project.id.getOrElse(-1), oldVisibility, data.project.visibility.nameKey)
UserActionLogger.log(request.request, LoggedAction.ProjectVisibilityChange, data.project.id.getOrElse(-1), data.project.visibility.nameKey, oldVisibility)
Redirect(ShowHome).withSuccess(request.messages.apply("project.deleted", data.project.name))
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/models/user/LoggedAction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ case object LoggedAction extends IntEnum[LoggedAction] {
case object VersionDescriptionEdited extends LoggedAction(12, "VersionDescriptionEdited", LoggedActionContext.Version, "The version description was edited")
case object VersionNonReviewChanged extends LoggedAction(17, "VersionNonReviewChanged", LoggedActionContext.Version, "If the review queue skip was changed")

case object UserTaglineChanged extends LoggedAction(14, "UserTaglineChanged", LoggedActionContext.User, "The users tagline changed")
case object UserPgpKeySaved extends LoggedAction(15, "UserPgpKeySaved", LoggedActionContext.User, "The users saved a pgp public key")
case object UserPgpKeyRemoved extends LoggedAction(16, "UserPgpKeyRemoved", LoggedActionContext.User, "The users removed a pgp public key")
case object UserTaglineChanged extends LoggedAction(14, "UserTaglineChanged", LoggedActionContext.User, "The user tagline changed")
case object UserPgpKeySaved extends LoggedAction(15, "UserPgpKeySaved", LoggedActionContext.User, "The user saved a PGP Public Key")
case object UserPgpKeyRemoved extends LoggedAction(16, "UserPgpKeyRemoved", LoggedActionContext.User, "The user removed a PGP Public Key")
val values: immutable.IndexedSeq[LoggedAction] = findValues

}
Expand Down

0 comments on commit b1ff063

Please sign in to comment.