[Patchew-devel] [PATCH v3] rest: add support for series DELETE in the REST API, and a corresponding unit test

Paolo Bonzini pbonzini at redhat.com
Wed Apr 4 17:28:49 UTC 2018


On 04/04/2018 19:15, Shubham Jain wrote:
> 
>     I changed this to IsMaintainerOrReadOnly and pushed the resulting patch.
> 
> I tried this as well. But it gave me 'Message' object has no attribute
> 'maintained_by'.

You are right, I wrote this just before pushing but... I lied.  Another
patch is needed, "rest: allow IsMaintainerOrReadOnly that applies to
Message".

Use the commit message to write information about your decisions
regarding the patch.  This includes decisions that you think are wrong,
but you had to make anyway because you were stuck! :)

>     As a next step, perhaps you can implement POST for /api/v1/messages?
>     That should accept a text/plain object; can you find the corresponding
>     legacy API endpoint?
> 
> Sure. You mean api/v1/projects/../messages?

/api/v1/messages is the important one.  This is because the "import"
view looks at an email, and uses the recipients to decide which projects
to use.

The code that does the import is add_message_from_mbox, in api/models.py.

We could add /api/v1/projects/.../messages (corresponding to a non-None
value of project_name).  It would be a good idea, but less important
because it has no equivalent in the old API.

> The legacy endpoint is
> import right? The import view is adding messages to the project.

Right!

Thanks,

Paolo




More information about the Patchew-devel mailing list