mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Made registration gravatar/email requests fail gracefully
* Extracted any email confirmation text into langs. * Added new notification on confirmation email send fail. Closes #187
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
use BookStack\Role;
|
||||
use BookStack\User;
|
||||
use Exception;
|
||||
use Setting;
|
||||
|
||||
class UserRepo
|
||||
@ -84,9 +85,14 @@ class UserRepo
|
||||
|
||||
// Get avatar from gravatar and save
|
||||
if (!config('services.disable_services')) {
|
||||
$avatar = \Images::saveUserGravatar($user);
|
||||
$user->avatar()->associate($avatar);
|
||||
$user->save();
|
||||
try {
|
||||
$avatar = \Images::saveUserGravatar($user);
|
||||
$user->avatar()->associate($avatar);
|
||||
$user->save();
|
||||
} catch (Exception $e) {
|
||||
$user->save();
|
||||
\Log::error('Failed to save user gravatar image');
|
||||
}
|
||||
}
|
||||
|
||||
return $user;
|
||||
|
Reference in New Issue
Block a user