diff --git a/manager/application/models/User.php b/manager/application/models/User.php index 7bf4030..27f8a44 100644 --- a/manager/application/models/User.php +++ b/manager/application/models/User.php @@ -394,14 +394,14 @@ class Default_Model_User { 'assigning challenge to user '.$this->id); } - if ($date === null) { - $date = new Zend_Date(); - } - $challenge = array(); $challenge['user_id'] = $this->id; $challenge['variant_id'] = $variant; - $challenge['pass_date'] = $date->toString('Y-m-d H:i:s'); + if ($date !== null) { + $challenge['pass_date'] = $date->toString('Y-m-d H:i:s'); + // otherwise default value of the database will be used + } + $this->db->insert('cats_passed', $challenge); $this->fixAssurerFlag();