|
15 | 15 | from invenio_communities.members.services.request import CommunityInvitation |
16 | 16 | from invenio_communities.proxies import current_identities_cache |
17 | 17 | from invenio_communities.subcommunities.services.request import ( |
18 | | - SubCommunityRequest, |
19 | 18 | SubCommunityInvitationRequest, |
| 19 | + SubCommunityRequest, |
20 | 20 | ) |
21 | 21 | from invenio_communities.utils import identity_cache_key |
22 | 22 | from invenio_communities.views.communities import render_community_theme_template |
@@ -245,7 +245,9 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) |
245 | 245 | is_record_inclusion = request_type == CommunityInclusion.type_id |
246 | 246 | is_member_invitation = request_type == CommunityInvitation.type_id |
247 | 247 | is_subcommunity_request = request_type == SubCommunityRequest.type_id |
248 | | - is_subcommunity_invitation_request = request_type == SubCommunityInvitationRequest.type_id |
| 248 | + is_subcommunity_invitation_request = ( |
| 249 | + request_type == SubCommunityInvitationRequest.type_id |
| 250 | + ) |
249 | 251 | request_is_accepted = request["status"] == AcceptAction.status_to |
250 | 252 |
|
251 | 253 | permissions = community.has_permissions_to( |
@@ -297,20 +299,7 @@ def community_dashboard_request_view(request, community, community_ui, **kwargs) |
297 | 299 | include_deleted=False, |
298 | 300 | ) |
299 | 301 |
|
300 | | - elif is_subcommunity_request: |
301 | | - return render_community_theme_template( |
302 | | - f"invenio_requests/{request_type}/index.html", |
303 | | - theme=community.to_dict().get("theme", {}), |
304 | | - base_template="invenio_communities/details/base.html", |
305 | | - invenio_request=request.to_dict(), |
306 | | - community=community_ui, |
307 | | - permissions=permissions, |
308 | | - request_is_accepted=request_is_accepted, |
309 | | - user_avatar=avatar, |
310 | | - include_deleted=False, |
311 | | - ) |
312 | | - |
313 | | - elif is_subcommunity_invitation_request: |
| 302 | + elif is_subcommunity_request or is_subcommunity_invitation_request: |
314 | 303 | return render_community_theme_template( |
315 | 304 | f"invenio_requests/{request_type}/index.html", |
316 | 305 | theme=community.to_dict().get("theme", {}), |
|
0 commit comments