Skip to content

Commit

Permalink
Merge pull request #206 from KE-works/205-retrieve-activity-closed-scope
Browse files Browse the repository at this point in the history
#205 fixed bug on retrieval of activity from closed scope in customis…
  • Loading branch information
jberends authored Sep 28, 2017
2 parents 2b1f2a9 + eec954b commit 64dcbd4
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Change Log

pykechain changelog

1.12.6 (28SEP17)
----------------
* fixed a bug in the `models.customisation`. After a succesfull save of a customisation to an activity, the activity could not be retrieved from KE-chain if the activity was part of a closed scope (#205)

1.12.5 (28SEP17)
----------------
* the `get_project()` helper method will now retrieve a scope a status other than 'ACTIVE' only (#203)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# General information about the project.
project = about.description
author = about.author
copyright = '2016, {}'.format(author)
copyright = '2017, {}'.format(author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -174,4 +174,4 @@
autodoc_member_order = 'bysource'
autoclass_content = 'both'

nbsphinx_execute = 'never'
nbsphinx_execute = 'never'
2 changes: 1 addition & 1 deletion pykechain/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = 'pykechain'
description = 'KE-chain Python SDK'

version = '1.12.5'
version = '1.12.6'

author = 'KE-works BV'
email = 'support+pykechain@ke-works.com'
3 changes: 2 additions & 1 deletion pykechain/models/customization.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def _save_customization(self, widgets):
if response.status_code != requests.codes.ok: # pragma: no cover
raise APIError("Could not save customization ({})".format(response))
else:
self.activity = self._client.scope(pk=self.activity.scope.get('id')).activity(pk=self.activity.id)
# refresh the activity json
self.activity = self._client.activity(pk=self.activity.id)

def _add_widget(self, widget):
"""
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"http_interactions": [{"recorded_at": "2017-09-26T14:36:12", "request": {"body": {"string": "", "encoding": "utf-8"}, "method": "GET", "headers": {"Accept-Encoding": "gzip, deflate", "User-Agent": "python-requests/2.18.4", "Accept": "*/*", "PyKechain-Version": "1.12.3", "X-Requested-With": "XMLHttpRequest", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive"}, "uri": "<API_URL>/api/scopes.json?name=Bike+Project+%28pykechain+testing%29&status=ACTIVE"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA6VT227bMAz9lUJPGxAlsuSb8tSt68OAARuwYg8bikIXOlFjy4YkbyuC/PvoXNr0oeiwwTIg0jw8JH24JQHi2KZIlj+2ZAwtWZJ1SkNcLhYbMFwNbr4BatbK+bnpuwU6FtH0A8RF2VTayIZRzmuguRWKSmsYBVOoqrCVgMzO72PvyYw4i4n/BoCxXnWA0e/dBi6+hP4eTLp4MzxgOVMVFwlicn71FiMT/E4YibeYVBqxCfLu6ubjt+vpW1A+uuR6f+ht7VbrFt8EWEoKI5yBrj59/nr94Yl6b5Pd7YyoGN3KAzr92LYz0kGnIRwyQqdce6A/4vA2RghH67Hkqf94d4CeuCeH8mr1zKNMcj/h0YGFVrvZE5G+1HPfvkQ3zeWU8t8J+TmhepVwMl9ja1QbX6IT53T3vVlDN8c04G28RN396sMmTrp7qYbnkP/ou5z+NgoipDur0pSas6yiLKO8vOFiyRie70hgR3glQo9mA6jLLel6C+1d6PtJpZXkShgNlImiRPXLnNZ53VBtjG604KwxYmrAYxXewAnWFDwTQgBVGViaQ1lQnZUllVI2MlOiNk12WrCcMUzOK5rh5tK8KhWteYULpqui4lBKAEZ2MzKE3kCclM+sgkIKSWshDM3rSlEty5yywuZGgGzASLIHrMIeweZ5XZfi7ClmBKxLSrePAx0gdA43Z797W2IC7Ad2FMI4HOZ3iLWootA/nEwMPe7nbne7+wNSaYc1nwQAAA==", "string": "", "encoding": null}, "url": "<API_URL>/api/scopes.json?name=Bike+Project+%28pykechain+testing%29&status=ACTIVE", "headers": {"Vary": "Accept-Encoding", "Transfer-Encoding": "chunked", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Content-Type": "application/json", "Date": "Tue, 26 Sep 2017 14:36:12 GMT", "X-Frame-Options": "SAMEORIGIN", "Content-Encoding": "gzip", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "X-Content-Type-Options": "nosniff"}, "status": {"code": 200, "message": "OK"}}}, {"recorded_at": "2017-09-26T14:36:12", "request": {"body": {"string": "", "encoding": "utf-8"}, "method": "GET", "headers": {"Accept-Encoding": "gzip, deflate", "User-Agent": "python-requests/2.18.4", "Accept": "*/*", "PyKechain-Version": "1.12.3", "X-Requested-With": "XMLHttpRequest", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive"}, "uri": "<API_URL>/api/activities.json?name=Specify+wheel+diameter&scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA51TTY/TMBT8K5FPINWp43znCPQG7EqEC6iKXPsl8TaNo9jZVan633lu6bKsOCCkRIrteeP3ZiYnMoNdBmdJ9f1ElnkgFemdm2y1Xu9BcjHpcA9U9kKPoTSHNW6shXT6UTsNdh1J2RYZS+gu2+U0kbmgRS5TmqUxxIniO5Wq8MGakayIVkj+LwWIHcUBEP1lAqnbY/DUAwyB0rjrYMZzBVbOenIamStS99oGTth90AsbiEAag+gXkBUR1upuBPCDEgfWHcQouguXXy0WP7fPMOy0FYOFFbFO4CHecXe/+ezBsxit9qRXyXrd9QO+zte4eXlZ8v7u0/3HTb358Hug2xY5by/A2TVKOH/CWZRTllFe1pxXjOHzzQ+6wGtEzP5ATLPp0ES8MArZCv0USo+XNQuTFZFmdGgejlcRpgSkZVzSIo4lTQoUf1dmCWWpSmQMZQuyRMbZGNf8R53Eu1GHRrjnbjlleR3FVVRUKQ9LrM8z3/QyqdfQkvKsjpIqzipWhCUvMh55KGZv7MA2g7CuedTw5JX+C30aZgnP+UUTK82Ekp1usr/TewjuZ/MA0gVvpiNG2yc68NbrsXt7S2fW5jtZtoxyXgBNVCxoqSSjIFORpyqPIVLkjDG5/gHHRmJX3uqvmJ8aA+j9gPmgMUaXhJx+TXrLBobSzeZ4W3qzrt9IKhfrzEH/ENdUj8swnLfnn/OMlBuiAwAA", "string": "", "encoding": null}, "url": "<API_URL>/api/activities.json?name=Specify+wheel+diameter&scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d", "headers": {"Vary": "Accept-Encoding", "Transfer-Encoding": "chunked", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Content-Type": "application/json", "Date": "Tue, 26 Sep 2017 14:36:12 GMT", "X-Frame-Options": "SAMEORIGIN", "Content-Encoding": "gzip", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "X-Content-Type-Options": "nosniff"}, "status": {"code": 200, "message": "OK"}}}, {"recorded_at": "2017-09-26T14:36:12", "request": {"body": {"string": "", "encoding": "utf-8"}, "method": "GET", "headers": {"Accept-Encoding": "gzip, deflate", "User-Agent": "python-requests/2.18.4", "Accept": "*/*", "PyKechain-Version": "1.12.3", "X-Requested-With": "XMLHttpRequest", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive"}, "uri": "<API_URL>/api/activities.json?name=Customized+task&scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA52TXW+bMBSG/wrz1SbFBJtPc7mud9vai0yTNlWRYx+IGwIIm7ZZlP/e40CmdNrFNMAC7Pccn4/HRzKAHRtnSfnzSMahISXZOtfbcrncgeKyN+EOqNpK04aq2y9xYimVM0/GGbDLqFJFBhugFdtwmuic00JUOa1yCQVwVcVxET7ariULYjQ6/xcD1LZyD6i+Ga3r9uYX6MBJu8MFDVYNpncGXZbt2DQLIq01dQvgcyAOrBstDOTh9wJuW8nGwoJYJ3ER/d7d335FZ26QrTXe15T/1tTbBofzNm4Yr01u7r7cf75d3X66im6eIqeHs3Bway0dXOLSI8z/hEcspxGnEVuxqExYiVURScJT9gPd9UNXYxtwlygU0Zt7gf2R2rTzahG/uRZEda3D1mC+WFotIRWxoKhSNClySTciS2iU6kTFICpQAncbus6t/8NOYSRYmLV01wnlKxaXrChTHgqe8KLwCY29/lMqKM9WLCnjrGQszAues8RLkay2BrtupHXrJwPPvvR/cZ+GmRBZxL2NVV2PVT1e+vDR7CC4H7pHUC543x8QXM9r4Fkwbf3hwl5W5RslqohyXgCyF0sqtIooqFTmqc5jYJqckJuJ78NaYVS+998QqNXEXw/D3iBXZ2SOc6YXWBBON3SHy69v3fSNTtWMspzQPRJ4cf71bHQN8/nDrlSm9rNPshl9aqutsQE+Mpjsg0n+DiN5cQdfBaKN7Rt5qAw05+jnovhD9/0sRjxPJxyvJoZipewDAAA=", "string": "", "encoding": null}, "url": "<API_URL>/api/activities.json?name=Customized+task&scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d", "headers": {"Vary": "Accept-Encoding", "Transfer-Encoding": "chunked", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Content-Type": "application/json", "Date": "Tue, 26 Sep 2017 14:36:12 GMT", "X-Frame-Options": "SAMEORIGIN", "Content-Encoding": "gzip", "Connection": "keep-alive", "X-XSS-Protection": "1; mode=block", "X-Content-Type-Options": "nosniff"}, "status": {"code": 200, "message": "OK"}}}], "recorded_with": "betamax/0.8.0"}
{"http_interactions": [{"response": {"url": "<API_URL>/api/scopes.json?name=Bike+Project+%28pykechain+testing%29&status=ACTIVE", "headers": {"Vary": "Accept-Encoding", "Date": "Thu, 28 Sep 2017 08:57:51 GMT", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "X-XSS-Protection": "1; mode=block", "Connection": "keep-alive", "Content-Type": "application/json", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", "Content-Encoding": "gzip"}, "status": {"code": 200, "message": "OK"}, "body": {"encoding": null, "base64_string": "H4sIAAAAAAAAA6VT227bMAz9lUJPGxAlsuSb8tSt68OAARuwYg8bikIXOlFjy4YkbyuC/PvoXNr0oeiwwTIg0jw8JH24JQHi2KZIlj+2ZAwtWZJ1SkNcLhYbMFwNbr4BatbK+bnpuwU6FtH0A8RF2VTayIZRzmuguRWKSmsYBVOoqrCVgMzO72PvyYw4i4n/BoCxXnWA0e/dBi6+hP4eTLp4MzxgOVMVFwlicn71FiMT/E4YibeYVBqxCfLu6ubjt+vpW1A+uuR6f+ht7VbrFt8EWEoKI5yBrj59/nr94Yl6b5Pd7YyoGN3KAzr92LYz0kGnIRwyQqdce6A/4vA2RghH67Hkqf94d4CeuCeH8mr1zKNMcj/h0YGFVrvZE5G+1HPfvkQ3zeWU8t8J+TmhepVwMl9ja1QbX6IT53T3vVlDN8c04G28RN396sMmTrp7qYbnkP/ou5z+NgoipDur0pSas6yiLKO8vOFiyRie70hgR3glQo9mA6jLLel6C+1d6PtJpZXkShgNlImiRPXLnNZ53VBtjG604KwxYmrAYxXewAnWFDwTQgBVGViaQ1lQnZUllVI2MlOiNk12WrCcMUzOK5rh5tK8KhWteYULpqui4lBKAEZ2MzKE3kCclM+sgkIKSWshDM3rSlEty5yywuZGgGzASLIHrMIeweZ5XZfi7ClmBKxLSrePAx0gdA43Z797W2IC7Ad2FMI4HOZ3iLWootA/nEwMPe7nbne7+wNSaYc1nwQAAA==", "string": ""}}, "recorded_at": "2017-09-28T08:57:51", "request": {"uri": "<API_URL>/api/scopes.json?name=Bike+Project+%28pykechain+testing%29&status=ACTIVE", "method": "GET", "headers": {"Accept": "*/*", "PyKechain-Version": "1.12.5", "Accept-Encoding": "gzip, deflate", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "User-Agent": "python-requests/2.18.4", "X-Requested-With": "XMLHttpRequest"}, "body": {"encoding": "utf-8", "string": ""}}}, {"response": {"url": "<API_URL>/api/activities.json?scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d&name=Specify+wheel+diameter", "headers": {"Vary": "Accept-Encoding", "Date": "Thu, 28 Sep 2017 08:57:51 GMT", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "X-XSS-Protection": "1; mode=block", "Connection": "keep-alive", "Content-Type": "application/json", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", "Content-Encoding": "gzip"}, "status": {"code": 200, "message": "OK"}, "body": {"encoding": null, "base64_string": "H4sIAAAAAAAAA51TTY+bMBT8K8inVoqJMR8Gjm1za7srlV5aRcixH+ANAYTNrtIo/73PSbPdrnqoKoGE7Xnj92aGE5nBLr2zpPx+Isvck5J0zk22XK/3oLicTLgHqjpphlCNhzVurKVy5tE4A3YdKdXkGUvoLtsJmighaS5USrM0hjjRfKdTHT7YcSArYjSS/0sBYgd5AER/mUCZ5hg8dQB9oA3uOpjxXINVs5mcQeaSVJ2xgZN2H3TSBjJQ44joF5AVkdaadgDwgxIH1h3kINsLl18tFj+3zzDstJG9hRWxTuIh3nF3v/nswbMcrPGkV8k603Y9vs7XuHl5WfL+7tP9x021+fB7oNsWOW8vwNnVWjp/wlkkKMsoLyrOS8bw+eYHXeA1ImZ/IKZ5bNFEvDAK2Qr9lNoMlzULkxVR4+DQPByvJExLSIu4oHkcK5rkKP6uyBLKUp2oGIoGVIGM8zi6+j/qFN6NOtTSPXfLKRNVFJdRXqY8LLBeZL7pZdKvoQXlecUQJ8okD5MiFhH3UMze0IKte2ld/WjgySv9F/o0zBIu+EUTq8YJJTvdZH9n9hDcz+MDKBe8mY4YbZ/owFtvhvbtLZ1ZI3aqaBjlPAea6FjSQitGQaVSpFrEEGlyxphc/4BjrbArb/VXzE+FAfR+wHwwGKNLQk6/Jr1lA0Pp5vF4W3qzrt9IqhbrxoP5Ia+pHpa+P2/PPwEvYoGkogMAAA==", "string": ""}}, "recorded_at": "2017-09-28T08:57:51", "request": {"uri": "<API_URL>/api/activities.json?scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d&name=Specify+wheel+diameter", "method": "GET", "headers": {"Accept": "*/*", "PyKechain-Version": "1.12.5", "Accept-Encoding": "gzip, deflate", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "User-Agent": "python-requests/2.18.4", "X-Requested-With": "XMLHttpRequest"}, "body": {"encoding": "utf-8", "string": ""}}}, {"response": {"url": "<API_URL>/api/activities.json?scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d&name=Customized+task", "headers": {"Vary": "Accept-Encoding", "Date": "Thu, 28 Sep 2017 08:57:51 GMT", "Allow": "GET, POST, HEAD, OPTIONS", "Server": "nginx/1.10.2", "X-XSS-Protection": "1; mode=block", "Connection": "keep-alive", "Content-Type": "application/json", "X-Frame-Options": "SAMEORIGIN", "Strict-Transport-Security": "max-age=518400; includeSubDomains", "Transfer-Encoding": "chunked", "X-Content-Type-Options": "nosniff", "Content-Encoding": "gzip"}, "status": {"code": 200, "message": "OK"}, "body": {"encoding": null, "base64_string": "H4sIAAAAAAAAA52TTY+bMBCG/wr1qZViYgwEzLHb3NruHlJVarWKHHsg3hBA2GQ3jfLfdxxIla16qApYgP3OeD4en0gPdqidJcXPExn6mhRk61xni/l8B4rLzoQ7oGorTROqdj/HiblUzhyMM2DnrFT5AjZAy2jDaaIzTnNRZrTMJOTAVRnHefhk24bMiNHo/F8MUNvIPaD6brCu3ZtfoAMn7Q4XNFjVm84ZdFk0Q13PiLTWVA2Az4E4sG6w0JPH3wu4bSlrCzNincRF9Hv/sPyKzlwvG2u8rzH/ram2NQ7nbVw/3Jrc3X95+LxcLT/dRDdNkfPjRdi7tZYOrnHpAaZ/wlmUUcYpi1YRK5KowKqIJOFp9APddX1bYRtwFxYK9uaeYX+kNs20msdvrhlRbeOwNZgvllZLSEUsKKoUTfJM0o1YJJSlOlExiBKUwN36tnXr/7BTGAkWZi3dbULZKoqLKC9SHgqe8Dz3CQ2d/lMqKM9XDHVZkUYhYzHnmZciWU0Fdl1L69YHA8++9H9xn4YLIRaMexur2g6rerr24aPZQfDQt0+gXPC+OyK4ntfAs2Ca6sOVvUWZbZQoGeU8B2QvllRoxSioVGapzmKINDkjNyPfx7XCqHzvvyFQq5G/Dvq9Qa4uyJymTK+wIJyub4/XX9+68RudqgllOaJ7IvDi/OvZ6Aqm84ddKU3lZw+yHnxqq62xAT4yGO2DUf4OI3lxR18Foo3tanksDdSX6Kei+EP3/SJGPM9nHK+1ZJcA7AMAAA==", "string": ""}}, "recorded_at": "2017-09-28T08:57:51", "request": {"uri": "<API_URL>/api/activities.json?scope=6f7bc9f0-228e-4d3a-9dc0-ec5a75d73e1d&name=Customized+task", "method": "GET", "headers": {"Accept": "*/*", "PyKechain-Version": "1.12.5", "Accept-Encoding": "gzip, deflate", "Authorization": "Token <AUTH_TOKEN>", "Connection": "keep-alive", "User-Agent": "python-requests/2.18.4", "X-Requested-With": "XMLHttpRequest"}, "body": {"encoding": "utf-8", "string": ""}}}], "recorded_with": "betamax/0.8.0"}
Loading

0 comments on commit 64dcbd4

Please sign in to comment.