mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update DeleteAccountPipeline
This commit is contained in:
parent
9c83451831
commit
fae385989e
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ use Illuminate\Queue\InteractsWithQueue;
|
|||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use DB;
|
||||
use Illuminate\Support\Str;
|
||||
use App\{
|
||||
AccountLog,
|
||||
Activity,
|
||||
|
@ -74,12 +75,16 @@ class DeleteAccountPipeline implements ShouldQueue
|
|||
$avatar = $user->profile->avatar;
|
||||
|
||||
if(is_file($avatar->media_path)) {
|
||||
if($avatar->media_path != 'public/avatars/default.png') {
|
||||
unlink($avatar->media_path);
|
||||
}
|
||||
}
|
||||
|
||||
if(is_file($avatar->thumb_path)) {
|
||||
if($avatar->thumb_path != 'public/avatars/default.png') {
|
||||
unlink($avatar->thumb_path);
|
||||
}
|
||||
}
|
||||
$avatar->forceDelete();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue