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

fixed bug with drafts not loading the guiding mode/optional properly #86

Merged
merged 1 commit into from
Sep 27, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion observation_portal/requestgroups/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ def perform_create(self, serializer):
serializer.save(author=self.request.user)

def get_queryset(self):
if self.request.user.is_authenticated:
if self.request.user.is_staff:
return DraftRequestGroup.objects.all()
elif self.request.user.is_authenticated:
return DraftRequestGroup.objects.filter(proposal__in=self.request.user.proposal_set.all())
else:
return DraftRequestGroup.objects.none()
8 changes: 7 additions & 1 deletion static/js/components/configuration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,19 @@
collapseMixin
],
data: function() {
let currentGuideOption = 'ON';
if (this.configuration.guiding_config.mode == 'OFF'){
currentGuideOption = 'OFF';
} else if (this.configuration.guiding_config.optional){
currentGuideOption = 'OPTIONAL';
}
return {
show: true,
acquireHistory: {
mode: '',
extra_params: {}
},
selectedImagerGuidingOption: 'OPTIONAL',
selectedImagerGuidingOption: currentGuideOption,
imagerGuidingOptions: [
{value: 'OPTIONAL', text: 'Optional'},
{value: 'ON', text: 'On'},
Expand Down