Wrong link, too few mandatory fields and NoneType error in Assessment Targets (dc module)
trendspotter opened this issue · comments
Steps to reproduce:
- Log in on an instance with Assessments (dc) module enabled
- Go to Assessments -> Templates -> Create
- Create a new template, fill in only mandatory fields (name)
- Go to Assessments -> Targets -> Create
- Create a new target, fill in only mandatory fields (template from step 3)
- Click on Report
Problem 1)
Data Collection Target name should be mandatory. If not given, the target is called "None".
Problem 2)
Report href leads to /eden/dc/results?viewing=dc_target.1
. This is presumably caused by the slash at the end of
Line 2379 in a1b1831
Problem 3)
After manually navigating to /eden/dc/target/1/results
, error 500 with following traceback is produced
Traceback (most recent call last):
File "/srv/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/srv/web2py/applications/eden/controllers/dc.py", line 200, in <module>
File "/srv/web2py/gluon/globals.py", line 421, in <lambda>
self._caller = lambda f: f()
File "/srv/web2py/applications/eden/controllers/dc.py", line 133, in target
return s3_rest_controller(rheader = s3db.dc_rheader,
File "/srv/web2py/applications/eden/models/00_utils.py", line 245, in s3_rest_controller
output = r(**attr)
File "/srv/web2py/applications/eden/modules/s3/s3rest.py", line 688, in __call__
output = handler(self, **attr)
File "/srv/web2py/applications/eden/modules/s3/s3rest.py", line 1775, in __call__
output = self.apply_method(r, **attr)
File "/srv/web2py/applications/eden/modules/s3db/dc.py", line 1565, in apply_method
output = self.html(r, title, **attr)
File "/srv/web2py/applications/eden/modules/s3db/dc.py", line 1771, in html
questions, stats = self._extract(r, **attr)
File "/srv/web2py/applications/eden/modules/s3db/dc.py", line 1679, in _extract
for posn in layout:
TypeError: 'NoneType' object is not iterable
//Edit: Note that the traceback is also mentioned at the end of report in #1543, but without steps to reproduce and without the other 2 errors mentioned above, hence the separate issue.
I will look at this, although note that the DC module isn't really usable in the default template (hence being moved to just Demo)...we /could/ re-enable the old Survey module as that does work, although isn't a good strategic tool as it was never too integrated into the rest of the system and can't be used on mobiles, etc.
What really need to happen for Default DC is to have the UCCE Editor back-ported to it....not a huge task but not trivial either...sponsorship welcomed ;)
Problem 1)
Data Collection Target name should be mandatory. If not given, the target is called "None".
I disagree...this is an optional field
Problem 2)
Report href leads to/eden/dc/results?viewing=dc_target.1
. This is presumably caused by the slash at the end of
Correct, thanks, Fixed
Problem 3)
After manually navigating to/eden/dc/target/1/results
, error 500 with following traceback is produced
for posn in layout:
TypeError: 'NoneType' object is not iterable
Thanks, Fixed...layout None is meaningless but we should catch the error gracefully.
Fixes in this commit:
81d40dc