Allow unsuspending from timed suspension

Fixes flarum/core#1345.
This commit is contained in:
Franz Liedke 2018-02-08 22:33:09 +01:00
parent 333bb702ed
commit f22c792fe0
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,9 @@ class SaveSuspensionToDatabase
$this->assertCan($actor, 'suspend', $user);
$user->suspend_until = new DateTime($attributes['suspendUntil']);
$user->suspend_until = $attributes['suspendUntil']
? new DateTime($attributes['suspendUntil'])
: null;
}
}
}

View File

@ -19,6 +19,6 @@ class SuspendValidator extends AbstractValidator
* {@inheritdoc}
*/
protected $rules = [
'suspendUntil' => ['date'],
'suspendUntil' => ['nullable', 'date'],
];
}