simo 2.8.2__py3-none-any.whl → 2.8.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.
Potentially problematic release.
This version of simo might be problematic. Click here for more details.
- simo/automation/__pycache__/controllers.cpython-312.pyc +0 -0
- simo/users/__pycache__/api.cpython-312.pyc +0 -0
- simo/users/__pycache__/models.cpython-312.pyc +0 -0
- simo/users/models.py +16 -3
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/METADATA +1 -1
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/RECORD +10 -10
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/LICENSE.md +0 -0
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/WHEEL +0 -0
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/entry_points.txt +0 -0
- {simo-2.8.2.dist-info → simo-2.8.3.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
simo/users/models.py
CHANGED
|
@@ -117,6 +117,7 @@ class InstanceUser(DirtyFieldsMixin, models.Model, OnChangeMixin):
|
|
|
117
117
|
class Meta:
|
|
118
118
|
unique_together = 'user', 'instance'
|
|
119
119
|
|
|
120
|
+
|
|
120
121
|
def __str__(self):
|
|
121
122
|
if self.role.instance:
|
|
122
123
|
return f"{self.user} is {self.role.name} on {self.instance}"
|
|
@@ -223,6 +224,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
223
224
|
def __init__(self, *args, **kwargs):
|
|
224
225
|
super().__init__(*args, **kwargs)
|
|
225
226
|
self._is_active = None
|
|
227
|
+
self._instances = None
|
|
228
|
+
self._instance_roles = {}
|
|
226
229
|
|
|
227
230
|
def __str__(self):
|
|
228
231
|
return self.name
|
|
@@ -266,6 +269,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
266
269
|
return self.is_active and self.is_master
|
|
267
270
|
|
|
268
271
|
def get_role(self, instance):
|
|
272
|
+
if instance.id in self._instance_roles:
|
|
273
|
+
return self._instance_roles[instance.id]
|
|
269
274
|
cache_key = f'user-{self.id}_instance-{instance.id}_role'
|
|
270
275
|
role = cache.get(cache_key)
|
|
271
276
|
if role is None:
|
|
@@ -276,7 +281,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
276
281
|
).first()
|
|
277
282
|
if role:
|
|
278
283
|
cache.set(cache_key, role, 20)
|
|
279
|
-
|
|
284
|
+
self._instance_roles[instance.id] = role
|
|
285
|
+
return self._instance_roles[instance.id]
|
|
280
286
|
|
|
281
287
|
@property
|
|
282
288
|
def role_id(self):
|
|
@@ -323,6 +329,9 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
323
329
|
if not self.is_active:
|
|
324
330
|
return Instance.objects.none()
|
|
325
331
|
|
|
332
|
+
if self._instances is not None:
|
|
333
|
+
return self._instances
|
|
334
|
+
|
|
326
335
|
cache_key = f'user-{self.id}_instances'
|
|
327
336
|
instances = cache.get(cache_key)
|
|
328
337
|
if instances is None:
|
|
@@ -336,7 +345,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
336
345
|
], is_active=True)
|
|
337
346
|
cache.set(cache_key, instances, 10)
|
|
338
347
|
|
|
339
|
-
|
|
348
|
+
self._instances = instances
|
|
349
|
+
return self._instances
|
|
340
350
|
|
|
341
351
|
@property
|
|
342
352
|
def component_permissions(self):
|
|
@@ -347,6 +357,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
347
357
|
|
|
348
358
|
@property
|
|
349
359
|
def is_active(self):
|
|
360
|
+
if self._is_active is not None:
|
|
361
|
+
return self._is_active
|
|
350
362
|
cache_key = f'user-{self.id}_is_active'
|
|
351
363
|
cached_value = cache.get(cache_key)
|
|
352
364
|
if cached_value is None:
|
|
@@ -372,7 +384,8 @@ class User(AbstractBaseUser, SimoAdminMixin):
|
|
|
372
384
|
self.instance_roles.filter(is_active=True).count()
|
|
373
385
|
)
|
|
374
386
|
cache.set(cache_key, cached_value, 20)
|
|
375
|
-
|
|
387
|
+
self._is_active = cached_value
|
|
388
|
+
return self._is_active
|
|
376
389
|
|
|
377
390
|
|
|
378
391
|
@is_active.setter
|
|
@@ -30,7 +30,7 @@ simo/automation/__pycache__/__init__.cpython-312.pyc,sha256=rIs1rkBbUhjXjbUffmq2
|
|
|
30
30
|
simo/automation/__pycache__/__init__.cpython-38.pyc,sha256=YmP0xAD-mxpQHgdTZeC64sXChA8TriMZD1jckNYi3xg,164
|
|
31
31
|
simo/automation/__pycache__/app_widgets.cpython-312.pyc,sha256=6u8LsTpf32yn0L49eI4A0sVHlSwl6gOyPlReUwQKoOM,577
|
|
32
32
|
simo/automation/__pycache__/app_widgets.cpython-38.pyc,sha256=7DfUA9V_1MiwrOe_ta-ts8dYY8xXb9UMg2_9A3XoRcs,523
|
|
33
|
-
simo/automation/__pycache__/controllers.cpython-312.pyc,sha256=
|
|
33
|
+
simo/automation/__pycache__/controllers.cpython-312.pyc,sha256=QV63g3UlpMAA-yCaZxoe1B2hVeDGobfOtBA0K1h66Os,15052
|
|
34
34
|
simo/automation/__pycache__/controllers.cpython-38.pyc,sha256=CL-0Tq9B4-E36fYfWT1XEBTq1dkq1W8003f6MrBnQU0,8391
|
|
35
35
|
simo/automation/__pycache__/forms.cpython-312.pyc,sha256=63rU0rWZk-Rz5qoMZiXl743WPc9NVm5d8bSd8w52T4E,12347
|
|
36
36
|
simo/automation/__pycache__/forms.cpython-38.pyc,sha256=cpA5hA2Iz3JsPC0Dq01ki1I7S9c5DKRcXveHApI1dJo,7772
|
|
@@ -10741,7 +10741,7 @@ simo/users/auto_urls.py,sha256=RSUW3ai5LbMTknS8M7M5aOnG_YlFOVQrnNVNH-fkwlg,357
|
|
|
10741
10741
|
simo/users/dynamic_settings.py,sha256=sEIsi4yJw3kH46Jq_aOkSuK7QTfQACGUE-lkyBogCaM,570
|
|
10742
10742
|
simo/users/managers.py,sha256=OHgEP85MBtdkdYxdstBd8RavTBT8F_2WyDxUJ9aCqqM,246
|
|
10743
10743
|
simo/users/middleware.py,sha256=tNPmnzo0eTrJ25SLHP7NotqYKI2cKnmv8hf6v5DLOWo,427
|
|
10744
|
-
simo/users/models.py,sha256=
|
|
10744
|
+
simo/users/models.py,sha256=EUsYX8PtPgRkpmCZXg0mRkYHV6e69TqGB-UkbZGe5Cw,20549
|
|
10745
10745
|
simo/users/permissions.py,sha256=IwtYS8yQdupWbYKR9VimSRDV3qCJ2jXP57Lyjpb2EQM,242
|
|
10746
10746
|
simo/users/serializers.py,sha256=REgXD9Af6nTRu_wUm1dt5YoCB6C_KNDaPqHZj726zZ0,2497
|
|
10747
10747
|
simo/users/sso_urls.py,sha256=gQOaPvGMYFD0NCVSwyoWO-mTEHe5j9sbzV_RK7kdvp0,251
|
|
@@ -10753,7 +10753,7 @@ simo/users/__pycache__/__init__.cpython-312.pyc,sha256=n0GE5zxjujBUkv1t1CswZ9Gby
|
|
|
10753
10753
|
simo/users/__pycache__/__init__.cpython-38.pyc,sha256=VFoDJE_SKKaPqqYaaBYd1Ndb1hjakkTo_u0EG_XJ1GM,211
|
|
10754
10754
|
simo/users/__pycache__/admin.cpython-312.pyc,sha256=lTVuZQwkuw1bzSn0A0kt-8H6ruKas_YPb_61AxSYSoo,11465
|
|
10755
10755
|
simo/users/__pycache__/admin.cpython-38.pyc,sha256=uL8TwAipkatZxanvQtBKKcOv8Fm3UvinBxsP0okrOZg,8443
|
|
10756
|
-
simo/users/__pycache__/api.cpython-312.pyc,sha256=
|
|
10756
|
+
simo/users/__pycache__/api.cpython-312.pyc,sha256=p8nEOe95slqWK0QxhAkmXXbyPiZd-0VcA-ejvFcS6Mo,18333
|
|
10757
10757
|
simo/users/__pycache__/api.cpython-38.pyc,sha256=zZ4DfNktgeVvLAtMpaPUv7AoAgbKr7SCt-4ghJk1zp4,10386
|
|
10758
10758
|
simo/users/__pycache__/apps.cpython-312.pyc,sha256=yLvyvcBuRr6jfIxwiA9sjQOE4VyHVUKl5FUVDPXuAkM,707
|
|
10759
10759
|
simo/users/__pycache__/apps.cpython-38.pyc,sha256=dgbWL8CxzzISJQTmq_4IztPJ2UzykNVdqA2Ae1PmeGk,605
|
|
@@ -10767,7 +10767,7 @@ simo/users/__pycache__/managers.cpython-312.pyc,sha256=A9-yF1dilDc1H_-BtrIw9USpH
|
|
|
10767
10767
|
simo/users/__pycache__/managers.cpython-38.pyc,sha256=O0Y8ABp42RAosrbODmYsPMaj9AyOPyJ-aqzuO0Qpi2s,679
|
|
10768
10768
|
simo/users/__pycache__/middleware.cpython-312.pyc,sha256=9pkiIkMriu0ExLK479hyPfaN-DOfp6WErqQlrZY1Mvk,927
|
|
10769
10769
|
simo/users/__pycache__/middleware.cpython-38.pyc,sha256=Tj4nVEAvxEW3xA63fBRiJWRJpz_M848ZOqbHioc_IPE,1149
|
|
10770
|
-
simo/users/__pycache__/models.cpython-312.pyc,sha256=
|
|
10770
|
+
simo/users/__pycache__/models.cpython-312.pyc,sha256=DownCK4FLYKjE-QMM1-ciZ0koLzwsnc_RFgyq5sIi8k,29596
|
|
10771
10771
|
simo/users/__pycache__/models.cpython-38.pyc,sha256=qNtAn_eWVmRTWhTxN8GtCc549dcJsTdaF7Uk19yNMgg,18330
|
|
10772
10772
|
simo/users/__pycache__/permissions.cpython-312.pyc,sha256=NCaxeIz4qmG_mF18lKTYXqOSUvJkFLnUZjfYIQFUCkU,718
|
|
10773
10773
|
simo/users/__pycache__/permissions.cpython-38.pyc,sha256=ez5NxoL_JUeeH6GsKhvFreuA3FCBgGf9floSypdXUtM,633
|
|
@@ -10924,9 +10924,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10924
10924
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10925
10925
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10926
10926
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10927
|
-
simo-2.8.
|
|
10928
|
-
simo-2.8.
|
|
10929
|
-
simo-2.8.
|
|
10930
|
-
simo-2.8.
|
|
10931
|
-
simo-2.8.
|
|
10932
|
-
simo-2.8.
|
|
10927
|
+
simo-2.8.3.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10928
|
+
simo-2.8.3.dist-info/METADATA,sha256=e73yT_ZPrUBSQ9WeaC3C_Ha7RqPRz8oRME8ayRXL1X4,2008
|
|
10929
|
+
simo-2.8.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10930
|
+
simo-2.8.3.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
10931
|
+
simo-2.8.3.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10932
|
+
simo-2.8.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|