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

Bugfixes #175

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Bugfixes #175

merged 3 commits into from
Jan 9, 2024

Conversation

femalves
Copy link
Contributor

@femalves femalves commented Jan 2, 2024

No description provided.

@@ -84,6 +84,7 @@ def get_libraries(cls, service_uid, absolute_uid, start=0, rows=None, sort_col="
.filter(Permissions.user_id == service_uid)\
.order_by(getattr(getattr(Library, sort_col), sort_order)())\
.all()
libraries_response = {'libraries_count': len(result)}
Copy link
Contributor Author

@femalves femalves Jan 2, 2024

Choose a reason for hiding this comment

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

Moving this because there was another result variable further down. When returning len(result) the output wasn't the expected one.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. It was a good idea to rename the result below to owner_permissions, owner. I don't think you need to break the tuple here, but it might be worth giving this a more descriptive name as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@tjacovich tjacovich left a comment

Choose a reason for hiding this comment

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

Looks good! Seeing as you tweaked the names of the other variables, I think it could be worth giving result a more descriptive name as well.

@@ -84,6 +84,7 @@ def get_libraries(cls, service_uid, absolute_uid, start=0, rows=None, sort_col="
.filter(Permissions.user_id == service_uid)\
.order_by(getattr(getattr(Library, sort_col), sort_order)())\
.all()
libraries_response = {'libraries_count': len(result)}
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. It was a good idea to rename the result below to owner_permissions, owner. I don't think you need to break the tuple here, but it might be worth giving this a more descriptive name as well.

if ownership:
response['my_libraries'] = my_libraries
response['shared_with_me'] = shared_with_me
libraries_response['my_libraries'] = my_libraries
Copy link
Contributor

Choose a reason for hiding this comment

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

Giving this a more descriptive name was a good idea for readability.

Copy link
Contributor

@tjacovich tjacovich left a comment

Choose a reason for hiding this comment

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

Looks good to me! Feel free to merge and version whenever you are ready.

@femalves femalves merged commit 71e7026 into master Jan 9, 2024
1 check passed
@femalves femalves deleted the bugfixes branch January 10, 2024 17:13
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.

2 participants