take personId into account in all relevant places
This commit is contained in:
parent
f2cf265d0c
commit
0cec511a9f
1 changed files with 3 additions and 3 deletions
|
@ -52,7 +52,7 @@ class SurveyView(InstitutionMixin, ConceptView):
|
||||||
|
|
||||||
template = template
|
template = template
|
||||||
|
|
||||||
adminMaySelectAllInstitutions = False
|
#adminMaySelectAllInstitutions = False
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def macro(self):
|
def macro(self):
|
||||||
|
@ -190,7 +190,7 @@ class SurveyView(InstitutionMixin, ConceptView):
|
||||||
data = respManager.load(uid, instUid)
|
data = respManager.load(uid, instUid)
|
||||||
if data:
|
if data:
|
||||||
resp = Response(self.adapted, self.personId)
|
resp = Response(self.adapted, self.personId)
|
||||||
for qu in self.adapted.questions:
|
for qu in self.adapted.getQuestions(self.personId):
|
||||||
if qu.questionType in (None, 'value_selection'):
|
if qu.questionType in (None, 'value_selection'):
|
||||||
if qu.uid in data:
|
if qu.uid in data:
|
||||||
value = data[qu.uid]
|
value = data[qu.uid]
|
||||||
|
@ -331,7 +331,7 @@ class SurveyView(InstitutionMixin, ConceptView):
|
||||||
def check(self, response):
|
def check(self, response):
|
||||||
errors = []
|
errors = []
|
||||||
values = response.values
|
values = response.values
|
||||||
for qu in self.adapted.questions:
|
for qu in self.adapted.getQuestions(self.personId):
|
||||||
if qu.required and qu not in values:
|
if qu.required and qu not in values:
|
||||||
errors.append(dict(uid=qu.uid,
|
errors.append(dict(uid=qu.uid,
|
||||||
text='Please answer the obligatory questions.'))
|
text='Please answer the obligatory questions.'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue