*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 423d5ca0 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Make PID option actually optional for file commands

parent 8f14076e
No related branches found
No related tags found
1 merge request!2Modernization
......@@ -17,8 +17,8 @@ from invenio_access.permissions import system_identity
from invenio_db import db
from invenio_files_rest.models import Location, ObjectVersion
from ..utils import get_identity_for_user, get_record_service
from .options import option_as_user, option_pid_type, option_pid_value
from ..utils import get_record_service
from .options import option_pid_type, option_pid_value_optional
from .utils import convert_to_recid
......@@ -69,7 +69,7 @@ def deleted():
@deleted.command("list")
@option_pid_value
@option_pid_value_optional
@option_pid_type
@with_appcontext
def list_deleted_files(pid, pid_type):
......@@ -107,7 +107,7 @@ def list_deleted_files(pid, pid_type):
@click.confirmation_option(
prompt="are you sure you want to permanently remove soft-deleted files?"
)
@option_pid_value
@option_pid_value_optional
@option_pid_type
@with_appcontext
def hard_delete_files(pid, pid_type):
......
......@@ -33,6 +33,15 @@ option_pid_type = click.option(
help="pid type for the lookup (default: 'recid')",
)
option_pid_value_optional = click.option(
"--pid",
"-p",
"pid",
metavar="PID_VALUE",
required=False,
help="persistent identifier of the object to operate on",
)
option_pid_value = click.option(
"--pid",
"-p",
......@@ -42,6 +51,7 @@ option_pid_value = click.option(
help="persistent identifier of the object to operate on",
)
option_pid_values = click.option(
"--pid",
"-p",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment