bugGNU Health - Bugs: bug #63871, Imaging Result Report:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #63871: Imaging Result Report: genshitemplateevalUndefinedError: None has no member named "rec_name"

Submitter:  Mathias Behrle <yangoon>
Submitted:  Sun 05 Mar 2023 09:16:01 PM UTC
   
 
Category:  reporting Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  meanmicio
Open/Closed:  Closed Release:  4.2.0
Module:  health_imaging Component:  Hospital Management

Tue 04 Apr 2023 05:44:02 PM UTC, comment #3: 

Hi, Mathias

Thank you! Indeed, good to check for both the request context and the request itself.

Just applied the patch on https://hg.savannah.gnu.org/hgweb/health/rev/1e412a2adb3c

Bests
Luis

comment #2:

> Hi Luis,
>
> thanks for spotting the typo. I tested the report and there is still missing an unhandled condition for context. Please have a look at the attached patch.
>
> Best
> Mathias
>
> (file #54556)

Luis Falcon <meanmicio>
Group administrator
Tue 04 Apr 2023 03:23:09 PM UTC, comment #2: 

Hi Luis,

thanks for spotting the typo. I tested the report and there is still missing an unhandled condition for context. Please have a look at the attached patch.

Best
Mathias

(file #54556)

Mathias Behrle <yangoon>
Mon 03 Apr 2023 05:12:44 PM UTC, comment #1: 

Thank you, Mathias!

Indeed, we need to check for the Imaging context before referring to it.

Fixed in https://hg.savannah.gnu.org/hgweb/health/rev/324f7ae87cb6

PS: Please check that there are a couple of typos in the file you attached (':: w' in study ID field and the context field is missing from the interpretation request.)

Please test changeset 5718:324f7ae87cb6 and let me know. Thanks again!

Bests
Luis

Luis Falcon <meanmicio>
Group administrator
Sun 05 Mar 2023 09:16:01 PM UTC, original submission:  

Printing the Imaging Test Result for TEST005 on the demo server:

Traceback (most recent call last):
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/evalpy", line 301, in lookup_attr
    val = getattr(obj, key)
AttributeError: 'NoneType' object has no attribute 'rec_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/evalpy", line 307, in lookup_attr
    val = obj[key]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/wsgipy", line 117, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/trytond/protocols/dispatcherpy", line 46, in rpc
    return methodsget(requestrpc_method, _dispatch)(
  File "/trytond/wsgipy", line 84, in auth_required
    return wrapped(args, *kwargs)
  File "/trytond/protocols/wrapperspy", line 159, in wrapper
    return func(request, pool, args, *kwargs)
  File "/trytond/protocols/dispatcherpy", line 180, in _dispatch
    result = rpcresult(meth(c_args, *c_kwargs))
  File "/trytond/report/reportpy", line 215, in execute
    oext, content = cls_execute(
  File "/trytond/report/reportpy", line 233, in _execute
    return clsconvert(action, clsrender(action, report_context))
  File "/trytond/report/reportpy", line 329, in render
    data = templategenerate(**report_context)render()
  File "/home/gnuhealth/local/lib/python39/site-packages/relatorio/templates/basepy", line 16, in render
    return selfserializer(
  File "/home/gnuhealth/local/lib/python39/site-packages/relatorio/templates/opendocumentpy", line 1157, in _call_
    output_encode(
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/outputpy", line 60, in encode
    for chunk in iterator:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/outputpy", line 243, in _call_
    for kind, data, pos in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/outputpy", line 674, in _call_
    for kind, data, pos in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/outputpy", line 779, in _call_
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/outputpy", line 598, in _call_
    for ev in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/relatorio/templates/opendocumentpy", line 1053, in _call_
    for kind, data, pos in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/filters/i18npy", line 789, in _call_
    for kind, data, pos in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/basepy", line 641, in _include
    for event in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/markuppy", line 326, in _match
    for event in stream:
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/basepy", line 601, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/basepy", line 290, in _eval_expr
    retval = exprevaluate(ctxt)
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/evalpy", line 160, in evaluate
    return eval(selfcode, globals, {'__data_': data})
  File "<string>", line 930, in <Expression '__relatorio_escape_invalid_chars(interpretationrequestcontextrec_name)'>
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/evalpy", line 309, in lookup_attr
    val = clsundefined(key, owner=obj)
  File "/home/gnuhealth/local/lib/python39/site-packages/genshi/template/evalpy", line 397, in undefined
    raise UndefinedError(key, owner=owner)
genshitemplateevalUndefinedError: None has no member named "rec_name"

Mathias Behrle <yangoon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #54556:  commit-59f5ac6 added by yangoon (2KiB - application/octet-stream)
file #54521:  imaging_study_report.fodt added by yangoon (140KiB - application/vnd.oasis.opendocument.text-flat-xml - Fixed report to workaround the problems)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by meanmicio (Posted a comment)
  • -email is unavailable- added by yangoon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-06 meanmicio StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-04-04 yangoon Attached File- Added commit-59f5ac6, #54556
    2023-04-03 meanmicio CategoryFunctionality reporting
        StatusNone Ready For Test
        Assigned toNone meanmicio
        ReleaseNone 4.2.0
        ComponentNone Hospital Management
    2023-03-22 yangoon Attached File- Added imaging_study_report.fodt, #54521

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code