mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Make survey always visible if license enables
Previously this would only be visible if survey is enabled. It should be possible to define and view a survey even if this is disabled. The enablement flag controls whether the survey prompt is shown and required.
This commit is contained in:
@@ -1907,8 +1907,11 @@ class JobTemplateSurveySpec(GenericAPIView):
|
|||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
obj = self.get_object()
|
obj = self.get_object()
|
||||||
if not obj.survey_enabled:
|
# Sanity check: Are surveys available on this license?
|
||||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
# If not, do not allow them to be used.
|
||||||
|
if not feature_enabled('surveys'):
|
||||||
|
raise LicenseForbids('Your license does not allow '
|
||||||
|
'adding surveys.')
|
||||||
return Response(obj.survey_spec)
|
return Response(obj.survey_spec)
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user