mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Provide a default non-NULL timezone in the PhabricatorUser class
Summary: Without this, user creation throws an exception when trying to insert NULL into a non-NULL field. Test Plan: Created a new user. Reviewed By: fratrik Reviewers: fratrik, toulouse, aran, jungejason, tuomaspelkonen CC: aran, fratrik Differential Revision: 480
This commit is contained in:
parent
3272008aef
commit
25bbe741f4
2 changed files with 9 additions and 2 deletions
|
@ -1,2 +1,2 @@
|
|||
ALTER TABLE phabricator_user.user
|
||||
ADD timezoneIdentifier varchar(255) NOT NULL DEFAULT "America/Los_Angeles";
|
||||
ADD timezoneIdentifier varchar(255) NOT NULL;
|
||||
|
|
|
@ -27,7 +27,7 @@ class PhabricatorUser extends PhabricatorUserDAO {
|
|||
protected $passwordSalt;
|
||||
protected $passwordHash;
|
||||
protected $profileImagePHID;
|
||||
protected $timezoneIdentifier;
|
||||
protected $timezoneIdentifier = '';
|
||||
|
||||
protected $consoleEnabled = 0;
|
||||
protected $consoleVisible = 0;
|
||||
|
@ -298,4 +298,11 @@ class PhabricatorUser extends PhabricatorUserDAO {
|
|||
return $preferences;
|
||||
}
|
||||
|
||||
public function getTimezoneIdentifier() {
|
||||
// If the user hasn't set one, guess the server's time.
|
||||
return nonempty(
|
||||
$this->timezoneIdentifier,
|
||||
date_default_timezone_get());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue