Skip to content

Commit

Permalink
update addremotesite command (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jun 11, 2024
1 parent 40f315a commit 78ee70c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions projectroles/management/commands/addremotesite.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ def add_arguments(self, parser):
type=bool,
help='User display of the remote site',
)
parser.add_argument(
'-o',
'--owner-modifiable',
dest='owner_modifiable',
default=True,
required=False,
type=bool,
help='Allow owners and delegates to modify project access for this '
'site',
)
# Additional Arguments
parser.add_argument(
'-s',
Expand Down Expand Up @@ -137,6 +147,7 @@ def handle(self, *args, **options):
'description': options['description'],
'secret': options['secret'],
'user_display': options['user_display'],
'owner_modifiable': options['owner_modifiable'],
}
site = RemoteSite.objects.create(**create_kw)

Expand Down
3 changes: 2 additions & 1 deletion projectroles/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def setUp(self):
'description': '',
'secret': REMOTE_SITE_SECRET,
'user_display': True,
'owner_modifiable': False,
'suppress_error': False,
}

Expand All @@ -124,7 +125,7 @@ def test_add(self):
'secret': REMOTE_SITE_SECRET,
'sodar_uuid': site.sodar_uuid,
'user_display': True,
'owner_modifiable': True,
'owner_modifiable': False,
}
self.assertEqual(model_to_dict(site), expected)
self.assertEqual(TimelineEvent.objects.filter(**tl_kwargs).count(), 1)
Expand Down

0 comments on commit 78ee70c

Please sign in to comment.