|
2 | 2 | import inspect |
3 | 3 | import re |
4 | 4 | from functools import lru_cache |
| 5 | +from urllib.parse import urlsplit |
5 | 6 |
|
6 | 7 | from django.core.exceptions import FieldDoesNotExist |
7 | 8 | from django.db.models import TextField |
@@ -386,7 +387,7 @@ def _decorate_layout_item(self, item): |
386 | 387 | # must be called from /form/ ... |
387 | 388 | path = re.sub(r'/form/?$', '', path) |
388 | 389 | path = '%s/autocomplete/%s/' % (path, name) |
389 | | - item['autocomplete_url'] = request.build_absolute_uri(path) |
| 390 | + item['autocomplete_url'] = urlsplit(request.build_absolute_uri(path)).path |
390 | 391 |
|
391 | 392 | # noinspection PyUnusedLocal |
392 | 393 | def _autocomplete(self, request, has_instance, **kwargs): |
@@ -473,7 +474,8 @@ def _decorate_layout_item(self, item): |
473 | 474 | # must be called from /form/ ... |
474 | 475 | path = re.sub(r'/form/?$', '', path) |
475 | 476 | path = '%s/foreign-autocomplete/%s/' % (path, item_id) |
476 | | - item['autocomplete_url'] = request.build_absolute_uri(path) |
| 477 | + item['autocomplete_url'] = urlsplit(request.build_absolute_uri(path)).path |
| 478 | + print(item['autocomplete_url']) |
477 | 479 |
|
478 | 480 | # noinspection PyUnusedLocal |
479 | 481 | def _foreign_autocomplete(self, request, has_instance, **kwargs): |
|
0 commit comments