great-components 2.2.1__py3-none-any.whl → 2.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,18 @@ from great_components import helpers
18
18
  logger = logging.getLogger(__name__)
19
19
 
20
20
 
21
+ def get_raw_uri(request):
22
+ """
23
+ Return an absolute URI from variables available in this request. Skip
24
+ allowed hosts protection, so may return insecure URI.
25
+ """
26
+ return '{scheme}://{host}{path}'.format(
27
+ scheme=request.scheme,
28
+ host=request._get_raw_host(),
29
+ path=request.get_full_path(),
30
+ )
31
+
32
+
21
33
  class MaintenanceModeMiddleware(MiddlewareMixin):
22
34
  maintenance_url = 'https://sorry.great.gov.uk'
23
35
 
@@ -70,7 +82,7 @@ class AbstractPrefixUrlMiddleware(abc.ABC, MiddlewareMixin):
70
82
  @staticmethod
71
83
  def get_redirect_domain(request):
72
84
  if settings.URL_PREFIX_DOMAIN:
73
- if not request.get_raw_uri().startswith(
85
+ if not get_raw_uri(request).startswith(
74
86
  settings.URL_PREFIX_DOMAIN
75
87
  ):
76
88
  return settings.URL_PREFIX_DOMAIN
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: great-components
3
- Version: 2.2.1
3
+ Version: 2.3.0
4
4
  Summary: Shared components library for Great services.
5
5
  Home-page: https://github.com/uktrade/great-components
6
6
  Author: DIT
@@ -14,6 +14,7 @@ Classifier: Framework :: Django :: 2.0
14
14
  Classifier: Framework :: Django :: 2.1
15
15
  Classifier: Framework :: Django :: 2.2
16
16
  Classifier: Framework :: Django :: 3.2
17
+ Classifier: Framework :: Django :: 4.2
17
18
  Classifier: Intended Audience :: Developers
18
19
  Classifier: License :: OSI Approved :: MIT License
19
20
  Classifier: Natural Language :: English
@@ -22,9 +23,9 @@ Classifier: Programming Language :: Python :: 3.6
22
23
  Classifier: Programming Language :: Python :: 3.9
23
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
25
  Description-Content-Type: text/markdown
25
- Requires-Dist: django (<=3.2.19,>=3.2.18)
26
+ Requires-Dist: django (<=4.2,>=3.2.18)
26
27
  Requires-Dist: beautifulsoup4 (<5.0.0,>=4.6.0)
27
- Requires-Dist: directory-constants (<=23.0.2,>=20.3.0)
28
+ Requires-Dist: directory-constants (<=23.1.0,>=20.3.0)
28
29
  Requires-Dist: jsonschema (<4.0.0,>=3.0.1)
29
30
  Provides-Extra: demo
30
31
  Requires-Dist: lorem (==0.1.1) ; extra == 'demo'
@@ -6,7 +6,7 @@ great_components/constants.py,sha256=0U3P3ec_f8f3XbEVCopTaUyGDqpSaV-8hnhGEMwb7dc
6
6
  great_components/context_processors.py,sha256=YkJPBLrrYnDYUHCpQP1shHommdj5NhgL-auww-DIiQE,4874
7
7
  great_components/decorators.py,sha256=dgT0IxSN0uTlCSzsAdGU9NsR9hqouk0YPkNNzefRKtE,311
8
8
  great_components/helpers.py,sha256=kOQqv4v2DSY5iKyseWnrMLawoa381GPRMgC7oHN3uCM,6908
9
- great_components/middleware.py,sha256=uiWzoM1_W2GBaXcZthq84ggDc989fi6uQ5d2MYNY0Ek,7028
9
+ great_components/middleware.py,sha256=9dVTTbMlTBnwcmDB3CDi6DGQrxiecOwY-Dg7lEOC_OQ,7361
10
10
  great_components/mixins.py,sha256=HRpV9YjN4zz8y9dlVnKJykDQr5KojNNF-nQH9FZFrNo,3009
11
11
  great_components/views.py,sha256=N2F6kvJUMmW9OQCIPcH16KMLlNhD_nrOTz_m0bnExZo,544
12
12
  great_components/forms/__init__.py,sha256=hKKA3w8GBglzmszrK3-z3n8DSRBKcBe9_TLrC52YbLI,153
@@ -634,8 +634,8 @@ great_components/templates/great_components/header_footer/search.html,sha256=SVU
634
634
  great_components/templates/great_components/header_footer/sso_login.html,sha256=IasiMYwuaTDbwpwYa2gLJcEQRIqZcZHGCpeh7Awvw9M,463
635
635
  great_components/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
636
636
  great_components/templatetags/great_components.py,sha256=VtVJpVHfYZ5zb4qlpFF8mbfs2nXLqjguYLV6iO8tXX0,12230
637
- great_components-2.2.1.dist-info/LICENSE,sha256=q4QjlbTN37umB_xq3DRmS0qvT2tMO_5_-u0WWzYcDQE,1091
638
- great_components-2.2.1.dist-info/METADATA,sha256=777gEHnerKbs7ye_UBOSbkQHtjbzckvNW5aLzwsmik8,10683
639
- great_components-2.2.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
640
- great_components-2.2.1.dist-info/top_level.txt,sha256=aI2xcjZzpL8o3QuUGQB5YkqHOknVkFwQOSZQiaNqRHU,22
641
- great_components-2.2.1.dist-info/RECORD,,
637
+ great_components-2.3.0.dist-info/LICENSE,sha256=q4QjlbTN37umB_xq3DRmS0qvT2tMO_5_-u0WWzYcDQE,1091
638
+ great_components-2.3.0.dist-info/METADATA,sha256=tWZtqnvNG1xrLM1dliFsV0CnAtGzlQnezsBIYR4zDoc,10719
639
+ great_components-2.3.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
640
+ great_components-2.3.0.dist-info/top_level.txt,sha256=aI2xcjZzpL8o3QuUGQB5YkqHOknVkFwQOSZQiaNqRHU,22
641
+ great_components-2.3.0.dist-info/RECORD,,