patchwork:pyup-update-jinja2-2.10.1-to-2.10.3

Last commit made on 2019-10-07
Get this branch:
git clone -b pyup-update-jinja2-2.10.1-to-2.10.3 https://git.launchpad.net/patchwork

Branch merges

Branch information

Name:
pyup-update-jinja2-2.10.1-to-2.10.3
Repository:
lp:patchwork

Recent commits

85c25db... by pyup-bot <email address hidden> on 2019-10-07

Update jinja2 from 2.10.1 to 2.10.3

f51e71d... by Stephen Finucane <email address hidden> on 2019-09-30

docs: Rename and make 'generate_schema' executable

A small Python 3 issue is resolved.

Signed-off-by: Stephen Finucane <email address hidden>

c8b3651... by Stephen Finucane <email address hidden> on 2019-09-27

Remove pwclient bashcomplete

This was also missed when moving pwclient to a separate repo. Fix it now.

Signed-off-by: Stephen Finucane <email address hidden>
Fixes: 90e85f9d ("Remove pwclient")

934888a... by Stephen Finucane <email address hidden> on 2019-09-27

Remove invalid symlink

This was missed when moving pwclient to a separate repo. Fix it now.

Signed-off-by: Stephen Finucane <email address hidden>
Fixes: 90e85f9d ("Remove pwclient")

ccad3da... by Stephen Finucane <email address hidden> on 2019-09-27

docs: Add documentation for pre-commit

Explain what it is and why you should use it.

Signed-off-by: Stephen Finucane <email address hidden>

ec0be31... by Stephen Finucane <email address hidden> on 2019-09-24

Integrate 'pre-commit'

Helps me avoid simple style issues. We explicitly disable newline checks
for some files where the "fix" would be harmful (e.g. mboxes and
templates).

Signed-off-by: Stephen Finucane <email address hidden>

3ebfcd4... by Stephen Finucane <email address hidden> on 2019-09-24

trivial: Style fixes

An assortment of fixes identified through the integration of pre-commit.

Signed-off-by: Stephen Finucane <email address hidden>

5d7d533... by Daniel Axtens on 2019-09-12

Move to msgid based URLs

Migrate our URL schema as follows:

Patches: /project/<linkname>/patch/<msgid>/
Cover Letters: /project/<linkname>/cover/<msgid>/

The usual sub-resources (mbox, raw) hang off those URLs.
The old style URLs (/patch/NNN/*, /cover/NNN/*) redirect appropriately.

I haven't attempted to do anything meaningful with series, and I
have dropped any attempt to provide a generic message-id lookup
or search functionality. One step at a time.

Our database still stores message ids as with angle brackets; we
just work around that rather than trying to migrate. That too can
come later if we think the pain is justified.

Partially-closes: #106
Reported-by: Konstantin Ryabitsev <email address hidden>
Reported-by-but-I-don't-want-to-spam: Linus Torvalds <email address hidden>
Reported-by: Stephen Finucane <email address hidden>
Signed-off-by: Daniel Axtens <email address hidden>

ab35df8... by Stephen Finucane <email address hidden> on 2019-09-21

Fix issue with delegation of patch via REST API

There have been reports of people being unable to delegate patches to
themselves, despite being a maintainer or the project to which the patch
is associated.

The issue is a result of how we do a check for whether the user is a
maintainer of the patch's project [1]. This check is checking if a given
'User.id' is in the list of items referenced by
'Project.maintainer_project'. However, 'Project.maintainer_project' is a
backref to 'UserProfile.maintainer_projects'. This means we're comparing
'User.id' and 'UserProfile.id'. Boo.

This wasn't seen in testing since we've had a post-save callback [2] for some
time that ensures we always create a 'UserProfile' object whenever we create a
'User' object. This also means we won't have an issue on deployments initially
deployed after that post-save callback was added, a 'User' with id=N will
always have a corresponding 'UserProfile' with id=N. However, that's not true
for older deployments such as the ozlabs.org one.

[1] https://github.com/getpatchwork/patchwork/blob/89c924f9bc/patchwork/api/patch.py#L108-L111
[2] https://github.com/getpatchwork/patchwork/blob/89c924f9bc/patchwork/models.py#L204-L210

Signed-off-by: Stephen Finucane <email address hidden>
Closes: #313
Reported-by: Bjorn Helgaas <email address hidden>

319b6f9... by Daniel Axtens on 2019-09-18

parsearchive, mail: use repr() to get a human readable exception

Currently if we have particular types of error in mail parsing
in parsearchive or parsemail, we print exc.message, which doesn't
always work:

  Traceback (most recent call last):
    File ".../patchwork/management/commands/parsearchive.py", line 90, in handle
      obj = parse_mail(msg, options['list_id'])
    File ".../patchwork/parser.py", line 961, in parse_mail
      raise ValueError("Missing 'Message-Id' header")
  ValueError: Missing 'Message-Id' header

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "manage.py", line 11, in <module>
      execute_from_command_line(sys.argv)
    File ".../django/core/management/__init__.py", line 381, in execute_from_command_line
      utility.execute()
    File ".../django/core/management/__init__.py", line 375, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File ".../django/core/management/base.py", line 323, in run_from_argv
      self.execute(*args, **cmd_options)
    File ".../django/core/management/base.py", line 364, in execute
      output = self.handle(*args, **options)
    File ".../patchwork/management/commands/parsearchive.py", line 100, in handle
      logger.warning('Invalid mail: %s', exc.message)
  AttributeError: 'ValueError' object has no attribute 'message'

repr(exc) will work. Use it.

Signed-off-by: Daniel Axtens <email address hidden>
Reviewed-by: Stephen Finucane <email address hidden>