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

systemfields: add parent community #1082

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

jrcastro2
Copy link
Contributor

@jrcastro2 jrcastro2 force-pushed the add-parent-systemfield branch from eef0415 to 712a438 Compare February 6, 2024 13:32
@jrcastro2 jrcastro2 force-pushed the add-parent-systemfield branch from 712a438 to f689afc Compare February 6, 2024 15:58
@jrcastro2 jrcastro2 force-pushed the add-parent-systemfield branch from f689afc to f522a50 Compare February 7, 2024 08:44
@jrcastro2 jrcastro2 marked this pull request as ready for review February 7, 2024 08:47
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

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

Reviewed with @0einstein0. Some minor comments on mixing service/data layers, but otherwise looks good.

invenio_communities/communities/services/service.py Outdated Show resolved Hide resolved
Comment on lines 57 to 63
if (
community.access.visibility_is_public
and record.access.visibility_is_public
):
record["parent"] = {"id": str(community.id)}
else:
raise ValueError("Parent community and child community must be public.")
Copy link
Member

Choose a reason for hiding this comment

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

minor: logically this would belong in the service layer, since here (in the data layer) we only care about managing the child/parent relationship in terms of data (not business rules/validation).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed it. Pinging @yashlamba as we probably want to add this check in the service layer.

@jrcastro2 jrcastro2 force-pushed the add-parent-systemfield branch 2 times, most recently from 141633c to 269fdfe Compare February 7, 2024 17:29
@slint slint force-pushed the add-parent-systemfield branch from 269fdfe to efa84ff Compare February 9, 2024 11:03
@slint slint merged commit 7f4e4fd into inveniosoftware:master Feb 9, 2024
2 checks passed
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.

ParentCommunity systemfield
3 participants