[Patchew-devel] [PATCH 2/4] git: add rendering of Results

Paolo Bonzini pbonzini at redhat.com
Thu May 3 09:24:54 UTC 2018


On 03/05/2018 11:20, Fam Zheng wrote:
>> +            if result.status == 'failed':
>> +                return format_html('Failed in applying to current master ({})', title, colorbox_a)
>> +            else:
>> +                if 'url' in result.data:
> result.data is None here if git.apply-failed:

Ah, that "failed" must be "failure".  It's probably best to make it more
"enum"-like by defining

   RESULT_SUCCESS = 'success'
   RESULT_FAILURE = 'failure'
   RESULT_PENDING = 'pending'
   RESULT_RUNNING = 'running'

Paolo

> Internal Server Error: /QEMU/717b8178-5a4e-49bd-8dc5-8cb5ef50aa12 at SHWDEOPENPSI011.local/
> Traceback (most recent call last):
>   File "/stor/work/patchew/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
>     response = get_response(request)
>   File "/stor/work/patchew/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
>     response = self.process_exception_by_middleware(e, request)
>   File "/stor/work/patchew/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
>     response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "/stor/work/patchew/www/views.py", line 273, in view_series_detail
>     results=prepare_results(request, s),
>   File "/stor/work/patchew/www/views.py", line 100, in prepare_results
>     html = result.render()
>   File "/stor/work/patchew/api/models.py", line 618, in render
>     return self.renderer.render_result(self)
>   File "/stor/work/patchew/mods/git.py", line 191, in render_result
>     if 'url' in result.data:
> TypeError: argument of type 'NoneType' is not iterable




More information about the Patchew-devel mailing list