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

permissions: add self-checkout #1222

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

ntarocco
Copy link
Contributor

No description provided.

@ntarocco ntarocco force-pushed the fix-self-checkout branch 4 times, most recently from f589607 to 9f1d393 Compare October 16, 2024 08:06
@ntarocco ntarocco changed the title ci: upgrade permissions: add self-checkout Oct 16, 2024
loan = kwargs.get("record", {})
is_patron_current_user = current_user.id == int(loan.get("patron_pid"))
loan = kwargs["record"]
is_patron_current_user = current_user.id == int(loan["patron_pid"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should really avoid using .get when the dict field is required. We need to fail early in these cases.

@@ -163,36 +168,41 @@ def __init__(self, record):
super().__init__(UserNeed(int(record["patron_pid"])), backoffice_access_action)


_is_authenticated_user = [
Copy link
Contributor Author

@ntarocco ntarocco Oct 16, 2024

Choose a reason for hiding this comment

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

Moved outside to declare them once, and not on each func call.

@ntarocco ntarocco force-pushed the fix-self-checkout branch 2 times, most recently from 4a050bf to 91ff204 Compare October 16, 2024 21:13
setup.cfg Outdated
@@ -28,6 +28,7 @@ zip_safe = False
install_requires =
# Invenio core modules
invenio-app>=1.3.4,<1.4.0
invenio-db[postgresql,mysql]>=1.0.14,<2.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

won't this install both dbs? also, seems like versioning is missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will install only the drivers/packages, we do this everywhere now.
Versioning was optional, it is now installed by default.

@@ -26,6 +26,11 @@ def get_active_loan_pid_and_item_pid():
if total > 0:
return t["pid"], active_loan[0]["pid"]

item = Item.get_record_by_pid("itmeid-1")
Copy link
Contributor

Choose a reason for hiding this comment

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

typo, probably this is breaking tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot!

@ntarocco ntarocco merged commit 05797ae into inveniosoftware:master Oct 28, 2024
5 checks passed
@ntarocco ntarocco deleted the fix-self-checkout branch October 28, 2024 08:17
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