1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Fix a bug where Phortune accounts created via "Create Account" would not have the viewer added as a member

Summary:
Ref T12451. When you explicitly created a second or third account or whatever, you wouldn't be added as a member.

(The editor sees that you're "already a member", so it doesn't add you.)

Test Plan:
  - Go to `/phortune/`.
  - Click "Switch Accounts".
  - Click "Create Account".
  - Create an account.
  - Before patch: unable to view it since you don't get added as a member.
  - After patch: account created with you as member.
  - Also created an accont with multiple members.
  - Tried to create an account with no members.
  - Tried to create an account with just someone else as a member.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12451

Differential Revision: https://secure.phabricator.com/D17690
This commit is contained in:
epriestley 2017-04-14 09:19:39 -07:00
parent 7274e4857c
commit e1a8b5d3e9

View file

@ -16,10 +16,8 @@ final class PhortuneAccount extends PhortuneDAO
private $memberPHIDs = self::ATTACHABLE;
public static function initializeNewAccount(PhabricatorUser $actor) {
$account = id(new PhortuneAccount());
$account->memberPHIDs = array($actor->getPHID() => $actor->getPHID());
return $account;
return id(new self())
->attachMemberPHIDs(array());
}
public static function createNewAccount(