Skip to content

Commit

Permalink
Merge pull request #31 from oarepo/has-draft-fix
Browse files Browse the repository at this point in the history
Fixed is_draft on records that do not have drafts
  • Loading branch information
SilvyPuzzlewell authored Jun 17, 2024
2 parents 2c94744 + 302255f commit 36394df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions oarepo_requests/types/ref_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ def __get__(self, obj, owner):
for ref_type in current_oarepo_requests.requests_entity_resolvers:
if not isinstance(ref_type, RecordResolver):
continue
if self.published and not ref_type.record_cls.is_draft:
is_draft = getattr(ref_type.record_cls, 'is_draft', False)
if self.published and not is_draft:
ret.append(ref_type.type_key)
elif self.draft and ref_type.record_cls.is_draft:
elif self.draft and is_draft:
ret.append(ref_type.type_key)
return ret

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-requests
version = 1.2.1
version = 1.2.2
description =
authors = Ronald Krist <[email protected]>
readme = README.md
Expand Down

0 comments on commit 36394df

Please sign in to comment.