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

cli: allow listing and setting default of locations #236

Merged
merged 9 commits into from
Feb 19, 2020

Conversation

ppanero
Copy link
Member

@ppanero ppanero commented Jan 30, 2020

Changes:

  • Allows listing locations
  • Allows setting a location as defautl (by name)
  • Fixes a bug: When a second location was created with --default there were two defaults in DB and therefore failing the uploading of files.

Duplicated of #235 Since the PR was from master branch I could not force push to squash commits.

Slight refactoring to fixt tests. (@wgresshoff sorry I had to take out the pretty print it is a nice addition but it requires a bigger refactor along invenio).

Warning it is not backwards compatible:

  • CLI location command is now a group to contain its related commands create, list and set_default.
  • Location.get_by_name() returns now one_or_none instead of one and raising an exception if it does not exist.

Requires

Closes #234
Closes #232

Pablo Panero and others added 2 commits January 30, 2020 10:55
Fix multiple defaults upon creation

Co-authored-by: Werner Gresshoff <gressho@uni-muenster.de>
Co-authored-by: Werner Gresshoff <gressho@uni-muenster.de>
@ppanero ppanero mentioned this pull request Jan 30, 2020
@ppanero ppanero changed the title Remote fix cli: allow listing and setting default of locations Jan 30, 2020
@ppanero ppanero requested a review from lnielsen January 30, 2020 10:48
Copy link
Contributor

@ntarocco ntarocco left a comment

Choose a reason for hiding this comment

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

LGTM 👍

invenio_files_rest/cli.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
invenio_files_rest/cli.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
@ppanero
Copy link
Member Author

ppanero commented Feb 11, 2020

Fails due to broken imports from Werkzeug (coming from bablex).

Copy link
Member

@lnielsen lnielsen left a comment

Choose a reason for hiding this comment

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

Are the broken tests related to the Werkzeug issues?

@ppanero
Copy link
Member Author

ppanero commented Feb 14, 2020

@lnielsen

Are the broken tests related to the Werkzeug issues?

Yes, coming from:

  • flask-babelex
  • flask-wtf
  • invenio-admin
  • flask-login

I bumped the minor version in all. However, flask-wtf is bumped a full minor. I checked the released notes and some method signatures have changed... Tests do not break, impact on the community - this PR will be a minor bump anyway - No?

@ppanero
Copy link
Member Author

ppanero commented Feb 18, 2020

@lnielsen tests are passing :)

@fenekku
Copy link
Contributor

fenekku commented Feb 18, 2020

All good on my side. I am not authorized to merge though; someone else will have to do it.

@lnielsen lnielsen merged commit af55c9f into inveniosoftware:master Feb 19, 2020
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.

cli: list locations new default location should remove previous "default" ones.
4 participants