Skip to content

Commit

Permalink
Fix bug when creating an organization owned project
Browse files Browse the repository at this point in the history
Signed-off-by: Walker Crouse <walkercrouse@hotmail.com>
  • Loading branch information
windy1 committed Dec 31, 2016
1 parent 68bf511 commit 717ef4d
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/models/project/ProjectSettings.scala
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import models.user.role.ProjectRole
import ore.permission.role.RoleTypes
import ore.project.{Categories, ProjectOwned}
import ore.user.notification.NotificationTypes
import play.api.Logger
import play.api.i18n.MessagesApi
import util.StringUtils._

@@ -115,6 +116,9 @@ case class ProjectSettings(override val id: Option[Int] = None,
*/
//noinspection ComparingUnrelatedTypes
def save(project: Project, formData: ProjectSettingsForm)(implicit messages: MessagesApi) = {
Logger.info("Saving project settings")
Logger.info(formData.toString)

project.category = Categories.withName(formData.categoryName)
project.description = nullIfEmpty(formData.description)

4 changes: 3 additions & 1 deletion app/ore/project/factory/PendingProject.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ore.project.factory

import db.ModelService
import db.impl.access.ProjectBase
import models.project.{Project, ProjectSettings}
import models.user.role.ProjectRole
@@ -26,13 +27,14 @@ case class PendingProject(projects: ProjectBase,
implicit val config: OreConfig,
var roles: Set[ProjectRole] = Set(),
override val cacheApi: CacheApi)
(implicit service: ModelService)
extends PendingAction[Project]
with Cacheable {

/**
* The [[Project]]'s internal settings.
*/
val settings = ProjectSettings()
val settings: ProjectSettings = this.service.processor.process(ProjectSettings())

/**
* The first [[PendingVersion]] for this PendingProject.
2 changes: 1 addition & 1 deletion app/util/DataHelper.scala
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ final class DataHelper @Inject()(config: OreConfig,
.ownerId(user.id.get)
.name(s"Project$projectNum")
.build())
project.settings = ProjectSettings()
project.settings = this.service.processor.process(ProjectSettings())
// Now create some additional versions for this project
var versionNum = 0
for (k <- 0 until channels) {
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "ore"

version := "1.1.0"
version := "1.1.1"

lazy val `ore` = (project in file(".")).enablePlugins(PlayScala)

0 comments on commit 717ef4d

Please sign in to comment.