mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update UserObserver
This commit is contained in:
parent
e3c11f76ae
commit
4ee3d10da8
1 changed files with 8 additions and 1 deletions
|
@ -20,7 +20,7 @@ class UserObserver
|
|||
public function saved(User $user)
|
||||
{
|
||||
if (empty($user->profile)) {
|
||||
DB::transaction(function() use($user) {
|
||||
$profile = DB::transaction(function() use($user) {
|
||||
$profile = new Profile();
|
||||
$profile->user_id = $user->id;
|
||||
$profile->username = $user->username;
|
||||
|
@ -38,9 +38,16 @@ class UserObserver
|
|||
$profile->private_key = $pki_private;
|
||||
$profile->public_key = $pki_public;
|
||||
$profile->save();
|
||||
return $profile;
|
||||
});
|
||||
DB::transaction(function() use($user, $profile) {
|
||||
$user = User::findOrFail($user->id);
|
||||
$user->profile_id = $profile->id;
|
||||
$user->save();
|
||||
|
||||
CreateAvatar::dispatch($profile);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (empty($user->settings)) {
|
||||
|
|
Loading…
Reference in a new issue