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

entity resolvers: resolve drafts for notification purposes #578

Conversation

anikachurilova
Copy link
Member

def matches_entity(self, entity):
"""Check if the entity is a result item."""
return isinstance(entity, (self.item_cls, self.record_cls))
try:
return isinstance(entity, (self.item_cls, self.record_cls, self.draft_cls))
Copy link
Member Author

Choose a reason for hiding this comment

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

Resolve draft to be able to send notifications for sharing access to drafts

return isinstance(entity, (self.item_cls, self.record_cls))
try:
return isinstance(entity, (self.item_cls, self.record_cls, self.draft_cls))
except AttributeError:
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit worried that attribute level might be a bit too generic and hide other exceptions (not only the ones produced by accessing self.item_cls self.record_cls, self.draft_cls), but I don't have a good alternative for now

@anikachurilova anikachurilova force-pushed the notifications-for-drafts branch from ae0251b to 6cd84a0 Compare May 24, 2024 12:08
return is_item_or_record

try:
return isinstance(entity, self.draft_cls)
Copy link
Contributor

Choose a reason for hiding this comment

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

after a round of a chat, I understood that this part should be probably placed in entity resolver dedicated to drafts

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.

deposit form: share draft
2 participants