Skip to content

Commit

Permalink
Merge branch 'oplog_skipped_even_if_OPLOG_is_True_#1095'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiarocci committed Mar 30, 2018
2 parents bee347f + 91edb11 commit 3996d90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Patches and Contributions
- Henrique Barroso
- Huan Di
- Hugo Larcher
- Hung Le
- James Stewart
- Jaroslav Semančík
- Javier Gonel
Expand Down
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Development

Version 0.8
~~~~~~~~~~~
- Fix: OPLOG skipped even if ``OPLOG = True``. Closes 1074 (Hung Le).
- Fix: Cannot define default projection and request specific field. Closes
#1036 (DHuan).
- Dev: pin testfixtures to v5.x as latest releases break on Python 2.6.
Expand Down
5 changes: 3 additions & 2 deletions eve/methods/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ def oplog_push(resource, document, op, id=None):
'r' = resource endpoint,
'o' = operation performed,
'i' = unique id of the document involved,
'pi' = client IP,
'ip' = client IP,
'c' = changes
config.LAST_UPDATED, config.LAST_CREATED and AUTH_FIELD are not being
Expand All @@ -1258,9 +1258,10 @@ def oplog_push(resource, document, op, id=None):
.. versionadded:: 0.5
"""

if not config.OPLOG \
or op not in config.OPLOG_METHODS\
or resource in config.URLS[resource]:
or resource not in config.URLS:
return

resource_def = config.DOMAIN[resource]
Expand Down
10 changes: 6 additions & 4 deletions eve/tests/methods/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,12 @@ def oplog_callback(resource, entries):
self.assertTrue('customvalue' in oplog_entry['extra']['customfield'])

def test_post_oplog(self):
r = self.test_client.post(self.known_resource_url,
data=json.dumps(self.data),
headers=self.headers,
environ_base={'REMOTE_ADDR': '127.0.0.1'})
r = self.test_client.post(
self.different_resource_url,
data=json.dumps({'username': 'test', 'ref':
'1234567890123456789012345' }),
headers=self.headers, environ_base={'REMOTE_ADDR': '127.0.0.1'})

r, status = self.oplog_get()
self.assert200(status)
self.assertEqual(len(r['_items']), 1)
Expand Down

0 comments on commit 3996d90

Please sign in to comment.