Allow admins request user backups

This commit is contained in:
Egor Kislitsyn 2020-09-18 22:18:34 +04:00
commit 7c22c9afb4
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
6 changed files with 57 additions and 12 deletions

View file

@ -30,12 +30,12 @@ defmodule Pleroma.Backup do
timestamps()
end
def create(user) do
def create(user, admin_user_id \\ nil) do
with :ok <- validate_email_enabled(),
:ok <- validate_user_email(user),
:ok <- validate_limit(user),
{:ok, backup} <- user |> new() |> Repo.insert() do
BackupWorker.process(backup)
BackupWorker.process(backup, admin_user_id)
end
end