0003-misc-remove-passerelle.compat-dependency-64409.patch
passerelle_minint/minint_maarch/views.py | ||
---|---|---|
16 | 16 | |
17 | 17 |
import base64 |
18 | 18 |
from datetime import datetime |
19 |
import json |
|
19 | 20 |
import logging |
20 | 21 |
import re |
21 | 22 |
import requests |
... | ... | |
26 | 27 |
from django.utils.encoding import force_text |
27 | 28 |
from django.views.decorators.csrf import csrf_exempt |
28 | 29 | |
29 |
from passerelle.compat import json_loads |
|
30 | 30 |
import passerelle.utils as utils |
31 | 31 |
from passerelle.soap import sudsobject_to_dict, client_to_jsondict |
32 | 32 |
from suds import TypeNotFound |
... | ... | |
86 | 86 |
@utils.protected_api('can_access') |
87 | 87 |
def post(self, request, *args, **kwargs): |
88 | 88 |
client = self.get_client() |
89 |
formdata = json_loads(request.body)
|
|
89 |
formdata = json.loads(request.body)
|
|
90 | 90 |
extras = formdata.get('extra', {}) |
91 | 91 | |
92 | 92 |
debug = 'debug' in request.GET |
... | ... | |
116 | 116 |
# get translations |
117 | 117 |
translations_txt = extras.get('translations') |
118 | 118 |
if translations_txt: |
119 |
self.translations = json_loads(translations_txt)
|
|
119 |
self.translations = json.loads(translations_txt)
|
|
120 | 120 |
# logger.debug('Translation JSON: %r', translations) |
121 | 121 | |
122 | 122 |
document = '<html>' |
... | ... | |
383 | 383 |
@utils.protected_api('can_access') |
384 | 384 |
def post(self, request, *args, **kwargs): |
385 | 385 |
client = self.get_client() |
386 |
formdata = json_loads(request.body)
|
|
386 |
formdata = json.loads(request.body)
|
|
387 | 387 |
extras = formdata.get('extra', {}) |
388 | 388 | |
389 | 389 |
debug = 'debug' in request.GET |
... | ... | |
484 | 484 |
@utils.protected_api('can_access') |
485 | 485 |
def post(self, request, *args, **kwargs): |
486 | 486 |
client = self.get_client() |
487 |
formdata = json_loads(request.body)
|
|
487 |
formdata = json.loads(request.body)
|
|
488 | 488 |
extras = formdata.get('extra', {}) |
489 | 489 |
logger.debug('formdata %r: ', formdata) |
490 | 490 |
debug = False # 'debug' in request.GET |
... | ... | |
514 | 514 |
translations_txt = extras.get('translations') |
515 | 515 | |
516 | 516 |
if translations_txt: |
517 |
self.translations = json_loads(translations_txt)
|
|
517 |
self.translations = json.loads(translations_txt)
|
|
518 | 518 |
logger.debug('Translation JSON: %r', self.translations) |
519 | 519 |
else: |
520 | 520 |
logger.debug('AUCUNE Translation JSON: %r', self.translations) |
passerelle_minint/minint_seisin/views.py | ||
---|---|---|
14 | 14 |
# You should have received a copy of the GNU Affero General Public License |
15 | 15 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 |
import json |
|
18 | ||
17 | 19 |
from django.views.generic import DetailView as GenericDetailView |
18 | 20 |
from django.utils.decorators import method_decorator |
19 | 21 |
from django.views.decorators.csrf import csrf_exempt |
20 | 22 | |
21 |
from passerelle.compat import json_loads |
|
22 | 23 |
import passerelle.utils as utils |
23 | 24 |
from passerelle.soap import sudsobject_to_dict, client_to_jsondict |
24 | 25 | |
... | ... | |
63 | 64 |
@utils.protected_api('can_access') |
64 | 65 |
def post(self, request, *args, **kwargs): |
65 | 66 |
client = self.get_client() |
66 |
formdata = json_loads(request.body)
|
|
67 |
formdata = json.loads(request.body)
|
|
67 | 68 |
fields = formdata.get('fields', {}) |
68 | 69 |
extras = formdata.get('extra', {}) |
69 | 70 |
workflow_fields = formdata.get('workflow', {}).get('fields', {}) |
tests/utils.py | ||
---|---|---|
8 | 8 |
from django.urls import reverse |
9 | 9 | |
10 | 10 |
from passerelle.base.models import ApiUser, AccessRight |
11 |
from passerelle.compat import json_loads |
|
12 | 11 | |
13 | 12 | |
14 | 13 |
def generic_endpoint_url(connector, endpoint, slug='test'): |
... | ... | |
29 | 28 |
headers = {} |
30 | 29 | |
31 | 30 |
def json(self): |
32 |
return json_loads(self.content)
|
|
31 |
return json.loads(self.content)
|
|
33 | 32 | |
34 | 33 | |
35 | 34 |
def mock_url(url=None, response='', status_code=200, headers=None): |
36 |
- |