Skip to content

Commit

Permalink
set creation date on election start_date and end_date fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed May 31, 2017
1 parent 40bee11 commit 03a6ff6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/ElectionsApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import models._
import utils._
import utils.JsonFormatters._
import utils.Response
import java.util.Date

import play.api._
import play.api.mvc._
Expand Down Expand Up @@ -489,7 +490,8 @@ object ElectionsApi
config =>
{
try {
val validated = config.validate(authorities, id)
val now = new java.sql.Timestamp(new Date().getTime)
val validated = config.validate(authorities, id).copy(start_date=now, end_date=now)
DB.withSession
{
implicit session =>
Expand Down

0 comments on commit 03a6ff6

Please sign in to comment.