Skip to content

Commit 4e73fae

Browse files
committed
mention inconsistency of news api
1 parent 8110874 commit 4e73fae

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/resources/news.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ new
6868
>>> news.save()
6969
<redminelib.resources.News #8 "Foo">
7070
71+
.. warning::
72+
73+
Redmine's News API doesn't return a news object after create operation. Due to the fact that it goes
74+
against the behaviour of all other API endpoints, Python-Redmine has to do some tricks under the hood
75+
to return a resource object which involve an additional API request. If that isn't desired one should
76+
use the following technique:
77+
78+
.. code-block:: python
79+
80+
with redmine.session(return_response=False):
81+
news = redmine.news.new()
82+
news.title = 'Foo'
83+
news.description = 'foobar'
84+
news.save()
85+
7186
Read methods
7287
------------
7388

0 commit comments

Comments
 (0)