Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,18 @@
</ToolBar>
<MainNavigationDrawer v-model="drawer" />
<LoadingText v-if="isLoading" />
<VLayout
v-else-if="isEmpty"
justify-center
fill-height
style="padding-top: 10%;"
>
<VFlex class="text-xs-center">
<h1 class="font-weight-bold headline mb-2">
{{ $tr('emptyChannelText') }}
</h1>
<p class="subheading">
{{ $tr('emptyChannelSubText') }}
</p>
</VFlex>
</VLayout>
<VContent v-else-if="isEmpty">
<VLayout justify-center fill-height class="pt-5">
<VFlex class="text-xs-center">
<h1 class="font-weight-bold headline mb-2">
{{ $tr('emptyChannelText') }}
</h1>
<p class="subheading">
{{ $tr('emptyChannelSubText') }}
</p>
</VFlex>
</VLayout>
</VContent>

<template v-else>
<ResizableNavigationDrawer
Expand Down Expand Up @@ -442,6 +439,7 @@
return this.loadCurrentChannel({ staging: true })
.then(() => {
if (!this.hasStagingTree) {
this.isLoading = false;
return;
}
Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const router = new VueRouter({
return next({
name: RouterNames.STAGING_TREE_VIEW,
params: {
nodeId: channel.staging_root_id,
nodeId: channel.staging_root_id || '',
},
replace: true,
});
Expand Down
15 changes: 9 additions & 6 deletions contentcuration/contentcuration/views/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def get_node_details_cached(node, channel_id=None):
@permission_classes((IsAuthenticated,))
def get_node_diff(request, updated_id, original_id):
try:
updated = ContentNode.objects.filter(pk=updated_id).first()
original = ContentNode.objects.filter(pk=original_id).first()
request.user.can_view_nodes([updated, original])
# Get queryset to test permissions
nodes = ContentNode.objects.filter(Q(pk=updated_id) | Q(pk=original_id))
updated = nodes.filter(pk=updated_id).first()
original = nodes.filter(pk=original_id).first()
request.user.can_view_nodes(nodes)

# Check to see if diff has been generated
data = get_diff(updated, original)
Expand All @@ -146,9 +148,10 @@ def get_node_diff(request, updated_id, original_id):
@permission_classes((IsAuthenticated,))
def generate_node_diff(request, updated_id, original_id):
try:
updated = ContentNode.objects.filter(pk=updated_id).first()
original = ContentNode.objects.filter(pk=original_id).first()
request.user.can_view_nodes([updated, original])
# Get queryset to test permissions
nodes = ContentNode.objects.filter(Q(pk=updated_id) | Q(pk=original_id))
request.user.can_view_nodes(nodes)

except PermissionDenied:
return Response('Diff is not available', status=status.HTTP_403_FORBIDDEN)

Expand Down