Conversation
602c778 to
2a5aa47
Compare
| "invenio_communities/details/requests/index.html", | ||
| theme=community_ui.get("theme", {}), | ||
| community=community_ui, | ||
| community_ui=community_ui, |
There was a problem hiding this comment.
Having the 2 vars with the same value is not super great. They have different purposes, see for example here.
I would suggest changing instead:
- the current var in the previous line, which is clearly wrongly named:
- community=community_ui,
+ community_ui=community_ui,- its usage in the template here
WDYT?
There was a problem hiding this comment.
the reason why i did the quick fix and add another variable with the same name and value was because i couldn't understand where community is used. since the refactor commit 9909924 introduced that bug, i thought it is safer to not remove community=community_ui
There was a problem hiding this comment.
so to be safe, all community variables would have to be renamed to community_ui in the context of invenio_communities/views/communities.py and the then used jinja templates?
There was a problem hiding this comment.
the reason why i did the quick fix and add another variable with the same name and value was because i couldn't understand where
communityis used. since the refactor commit 9909924 introduced that bug, i thought it is safer to not removecommunity=community_ui
It should be in the view's template (I linked it above).
so to be safe, all
communityvariables would have to be renamed tocommunity_uiin the context ofinvenio_communities/views/communities.pyand the then used jinja templates?
Only the ones that have value community_ui -> community=community_ui. Basically, community is the obj, and community_ui it serialized version, they are different. We should keep naming consistent to mark the difference.
There was a problem hiding this comment.
Only the ones that have value
community_ui->community=community_ui. Basically, community is the obj, and community_ui it serialized version, they are different. We should keep naming consistent to mark the difference.
i think that doesn't work either without putting more thinking and testing time into it. for communities_subcommunities community is used here and here. can i replace that with community_ui["metadata"]["title"] and community_ui["slug"]?
btw this is also a problem here
so it could be that i need community=community and community_ui=community_ui, or i refactor the usage of community.metadata etc completly
There was a problem hiding this comment.
For the time being, fine by me adding both:
community=community
community_ui=community_ui6ad15ce to
56effdb
Compare
* the variable name in communities_requests is community and not community_ui, so add community_ui=community_ui
56effdb to
128cfee
Compare
community_ui