[PATCH 0/5] Add submission relations

Daniel Axtens dja at axtens.net
Fri Oct 18 19:29:05 AEDT 2019


Daniel Axtens <dja at axtens.net> writes:

> Hi Mete,
>
> I applied this series, ran the migration, and hit this bug:
>
> File "/opt/pyenv/versions/3.7.4/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
>   34.             response = get_response(request)
>
> File "/opt/pyenv/versions/3.7.4/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
>   115.                 response = self.process_exception_by_middleware(e, request)
>
> File "/opt/pyenv/versions/3.7.4/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
>   113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
>
> File "/home/patchwork/patchwork/patchwork/views/patch.py" in patch_detail
>   113.     related_outside = patch.related.submissions.exclude(project=patch.project)
>
> Exception Type: AttributeError at /project/patchwork/patch/20191002121316.5151f100 at elm.ozlabs.ibm.com/
> Exception Value: 'NoneType' object has no attribute 'submissions'
>
> Haven't had a chance to debug it yet.

diff --git patchwork/views/patch.py patchwork/views/patch.py
index 84b8659c3dcc..ac490d2d2321 100644
--- patchwork/views/patch.py
+++ patchwork/views/patch.py
@@ -110,7 +110,10 @@ def patch_detail(request, project_id, msgid):
     comments = comments.only('submitter', 'date', 'id', 'content',
                              'submission')
 
-    related_outside = patch.related.submissions.exclude(project=patch.project)
+    if patch.related:
+        related_outside = patch.related.submissions.exclude(project=patch.project)
+    else:
+        related_outside = []
 
     context['comments'] = comments
     context['checks'] = patch.check_set.all().select_related('user')


>
> Regards,
> Daniel
>
>> From: Mete Polat <metepolat2000 at gmail.com>
>>
>> This patch introduces the ability to view relations between submissions by
>> creating and updating them via the REST API.
>>
>> Changes since v1:
>> - Allow cover letters to be in relations as well (submission relations)
>> - Move from Django permission to a maintainer based one (and update tests)
>> - Drop bulk support
>>   I decided to drop the bulk support in favour of an easier implementation,
>>   usability and maintainability.
>> - Drop support for manually setting relation id
>> - Group relations from other projects separately
>> - Split up UI changes
>>
>> Mete Polat (5):
>>   ui: Retain table header position on size changes
>>   ui, templates: Combine series and related row
>>   models, templates: Add sumbission relations
>>   docs: Add missing series index schema
>>   REST: Add submission relations
>>
>>  docs/api/schemas/latest/patchwork.yaml        | 223 +++++++++++++++++
>>  docs/api/schemas/patchwork.j2                 | 235 ++++++++++++++++++
>>  docs/api/schemas/v1.0/patchwork.yaml          |   5 +
>>  docs/api/schemas/v1.1/patchwork.yaml          |   5 +
>>  docs/api/schemas/v1.2/patchwork.yaml          | 223 +++++++++++++++++
>>  htdocs/css/style.css                          |   4 +-
>>  patchwork/api/index.py                        |   1 +
>>  patchwork/api/relation.py                     |  73 ++++++
>>  .../migrations/0037_submission_relations.py   |  28 +++
>>  patchwork/models.py                           |   9 +
>>  patchwork/templates/patchwork/submission.html | 101 +++++---
>>  patchwork/tests/api/test_relation.py          | 194 +++++++++++++++
>>  patchwork/tests/utils.py                      |  11 +
>>  patchwork/urls.py                             |  11 +
>>  patchwork/views/patch.py                      |   3 +
>>  ...submission-relations-c96bb6c567b416d8.yaml |  10 +
>>  16 files changed, 1102 insertions(+), 34 deletions(-)
>>  create mode 100644 patchwork/api/relation.py
>>  create mode 100644 patchwork/migrations/0037_submission_relations.py
>>  create mode 100644 patchwork/tests/api/test_relation.py
>>  create mode 100644 releasenotes/notes/add-submission-relations-c96bb6c567b416d8.yaml
>>
>> -- 
>> 2.20.1 (Apple Git-117)
>>
>> _______________________________________________
>> Patchwork mailing list
>> Patchwork at lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list