Skip to content
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

Tweak import model to avoid manual construction of user tag string #1062

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Oct 16, 2023

Description

Tweak import model to avoid manual construction of user tag string - done to address #1056 (comment)

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 mentioned this pull request Oct 16, 2023
3 tasks
Copy link
Collaborator

@alesstimec alesstimec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

if newOwner != "" {
// Switch the model to be owned by the specified user.
ownerString = names.UserTagKind + "-" + newOwner
if !names.IsValidUser(newOwner) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

puuurrrrfect!

if newOwner != "" {
// Switch the model to be owned by the specified user.
ownerString = names.UserTagKind + "-" + newOwner
if !names.IsValidUser(newOwner) {
return errors.E(op, "invalid new username for new model owner")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps also include the bad request code

@kian99 kian99 force-pushed the minor-refactor-import-model branch from a8bbe54 to 2b896eb Compare October 16, 2023 08:02
@kian99 kian99 merged commit d33b34f into canonical:main Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants