utg-base 1.20.1__py3-none-any.whl → 1.20.3__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.
@@ -21,7 +21,7 @@ def generate_perm_cache_key(user_id: str):
21
21
 
22
22
  def has_perm(user_id, perm, request=None):
23
23
  if (request is not None and isinstance(request, Request)
24
- and (request.user.is_superuser or request.user.accessibility == AccessibilityType.ADMIN)):
24
+ and (request.user.is_superuser or safe_get(request, 'user.accessibility') == AccessibilityType.ADMIN)):
25
25
  return True
26
26
  redis_conn: Redis = get_redis_connection("shared")
27
27
  perm = f"{to_snake_case(env('APP_NAME'))}:{perm}"
@@ -30,7 +30,7 @@ def has_perm(user_id, perm, request=None):
30
30
 
31
31
  def has_perms(user_id: str, perms: list[str], operator: Literal["OR", "AND"] = "OR", request=None):
32
32
  if (request is not None and isinstance(request, Request)
33
- and (request.user.is_superuser or request.user.accessibility == AccessibilityType.ADMIN)):
33
+ and (request.user.is_superuser or safe_get(request, 'user.accessibility') == AccessibilityType.ADMIN)):
34
34
  return True
35
35
  redis_conn: Redis = get_redis_connection("shared")
36
36
  perms = [f"{to_snake_case(env('APP_NAME'))}:{perm}" for perm in perms]
@@ -128,6 +128,7 @@ def create_serializer_for_partial_update(model: Model):
128
128
  fields = '__all__'
129
129
  read_only_fields = list(
130
130
  {
131
+ *get_api_meta_property(model, 'readonly_fields'),
131
132
  'created_at',
132
133
  'updated_at',
133
134
  'deleted_at',
@@ -173,6 +174,7 @@ def create_serializer(model: Model, depth=0):
173
174
  fields = '__all__'
174
175
  read_only_fields = list(
175
176
  {
177
+ *get_api_meta_property(model, 'readonly_fields'),
176
178
  'created_at',
177
179
  'updated_at',
178
180
  'deleted_at',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: utg-base
3
- Version: 1.20.1
3
+ Version: 1.20.3
4
4
  Summary: UTG Base Package
5
5
  Author: Olimboy
6
6
  Author-email: shavkatov.olimboy@mail.ru
@@ -42,12 +42,12 @@ utg_base/models/timestamp.py,sha256=AkCliNXnvs8Z17b1mcS7gOK7v6h3Jul6WCyGyVAkb-w,
42
42
  utg_base/permissions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  utg_base/permissions/decorators.py,sha256=g-ozzjkjJ-O69_wHWzZnZ9jitFR6MxqGLz2skFjzht4,2118
44
44
  utg_base/permissions/folder.py,sha256=uJv40FVb7R379qss66a5oUcLK7KCUIL6DPbzEcGOw38,694
45
- utg_base/permissions/utils.py,sha256=ZoPlqVRmAQv8IS7AYWN1uEWj0CjTt_y5gy7A5hz2His,3238
45
+ utg_base/permissions/utils.py,sha256=Rp8_ZuU5SdXri4amfFlMmrBoJUjwwQ4GYxDujRpt8YU,3264
46
46
  utg_base/references_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  utg_base/references_api/apps.py,sha256=thAGmO-ZT-OD9dHHBSQRL_RRt-Es_jt-mEmHgVTpERs,168
48
48
  utg_base/references_api/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  utg_base/references_api/urls.py,sha256=WkLACQ8GfK5pJkvt8FuYdOxcqSZHj7pYRw51M9WluGw,390
50
- utg_base/references_api/utils.py,sha256=2mdwI1lyHOsLinhBz19regtDdESjnx52BlWyaAq8EGk,6032
50
+ utg_base/references_api/utils.py,sha256=dpeVMJnvMDrCCueoIti7e3xVjH2Uc1gdBd2sUQTivis,6172
51
51
  utg_base/services/__init__.py,sha256=LqtwUiqEZPIbKRGJfve5D5m3ucV6Kw1Nbo5Jnj_hPhY,37
52
52
  utg_base/services/base_api.py,sha256=bMTmjy8TRN4WTCgV_1RvkquoqijJQ1hP7BBtPgW_AH0,5677
53
53
  utg_base/signals/__init__.py,sha256=5SKumqAQrfrXUzi4NO3zjPAXV2TG3EDKxOomaF-e15M,35
@@ -69,6 +69,6 @@ utg_base/utils/sql.py,sha256=rqIWcSjdjIMszdRnsnhV5TTYB8W17RPOujIQA9rKC_Y,762
69
69
  utg_base/utils/string.py,sha256=ATwIo9uLa00p85h_NjRYLcjRs8o3KSGF7s2yhTg5GiA,1073
70
70
  utg_base/utils/thread.py,sha256=4RqRnwtyHymY-dNcuPrMSTamE2V7wCMVfzzyIb0P4TI,2191
71
71
  utg_base/utils/translation.py,sha256=GxJHUt0iar_0E7RWBPbeLFQ4DhgXBjffHCmxfKyjFtk,463
72
- utg_base-1.20.1.dist-info/METADATA,sha256=9woVQrxpTRysd2OTm8ozxRnEpdGdS61GcwCd9YPig90,960
73
- utg_base-1.20.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
74
- utg_base-1.20.1.dist-info/RECORD,,
72
+ utg_base-1.20.3.dist-info/METADATA,sha256=bZXJfIU2DMV8KCMy6fsT5XYL9vesEECby5UmYSad1j8,960
73
+ utg_base-1.20.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
74
+ utg_base-1.20.3.dist-info/RECORD,,