-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add edit support for some legacyrole fields. #1943
Conversation
6c9bc91
to
e10bc60
Compare
No-Issue Signed-off-by: James Tanner <[email protected]>
e10bc60
to
ef60472
Compare
No-Issue Signed-off-by: James Tanner <[email protected]>
No-Issue Signed-off-by: James Tanner <[email protected]>
Signed-off-by: James Tanner <[email protected]>
@@ -336,6 +342,40 @@ def get_download_count(self, obj): | |||
return 0 | |||
|
|||
|
|||
class LegacyRoleRepositoryUpdateSerializer(serializers.Serializer): | |||
name = serializers.CharField(required=False, allow_blank=False, max_length=50) | |||
original_name = serializers.CharField(required=False, allow_blank=False, max_length=50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm able to edit original_name
in the repository, is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I think longterm, no you shouldn't be able to. For the short term though, we need to be able to set that based on the old api data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
but question: we don't allow updating tags
or description
, AFAIK that happens when a user creates the role and to update, he has to create a new version with updated desc and tags?
@jerabekjiri yep, description and tags will come from the meta/main.yml at [re-]import time. The editable fields in this PR were selected because they directly affect imports and installs. |
A lot of the old legacy roles had their github_user, github_repo, repository.name, namespace.name, name changed over the years. We need a way to alter those fields from the API as people change the source data.
This PR does some hacky things because the data is still all in the json fullmetadata column. In a future PR I want to migrate all the important keys out to 1st class model fields and apply proper constraints.