Skip to content

Create check-in on reading log add #6987

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

Closed

Conversation

jimchamp
Copy link
Collaborator

Automatically creates a check-in event whenever a book is added to "Currently Reading" or "Already Read" reading logs.

Blocked by #6662 --- Once that is merged, this will need to be rebased.

Technical

Testing

Screenshot

Stakeholders

- Add minimal UI for POSTing new check-ins
- UI only accessible to admins
- UI is expected to be temporary. Its purpose is to demonstrate how
check-in data is POSTed, and to provide a quick way to add dummy check-
ins
- Change `json` endpoint
- Change is_valid
- Extend persistence class from `CommonExtras`
@jimchamp jimchamp added the State: Blocked Work has stopped, waiting for something (Info, Dependent fix, etc. See comments). [managed] label Sep 21, 2022
FINISH = 3

@classmethod
def has_key(cls, key: str) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this work? has_key() is kinda passe.

Suggested change
def has_key(cls, key: str) -> bool:
def __contains__(cls, key: str) -> bool:

https://portingguide.readthedocs.io/en/latest/dicts.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for this note! I tried this and was seeing TypeDef errors when checking if an int was in BookshelfEvents. I applied this review note and fixed the error in #7212

Comment on lines +337 to +338
today = date.today()
date_str = f'{today.year}-{today.month:02}-{today.day:02}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
today = date.today()
date_str = f'{today.year}-{today.month:02}-{today.day:02}'
date_str = f"{date.today():%Y-%m-%d}"

Comment on lines +72 to +74
if not BookshelfEvent.has_key(data['event_type']):
return False
return True
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if not BookshelfEvent.has_key(data['event_type']):
return False
return True
return BookshelfEvent.has_key(data['event_type'])

@bicolino34 bicolino34 removed the State: Blocked Work has stopped, waiting for something (Info, Dependent fix, etc. See comments). [managed] label Oct 12, 2022
@jimchamp
Copy link
Collaborator Author

jimchamp commented Dec 3, 2022

Closing this as we have decided that patrons should check in manually.

@jimchamp jimchamp closed this Dec 3, 2022
@jimchamp jimchamp deleted the feature/automatic-check-ins branch December 9, 2022 23:24
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