simo 2.0.4__py3-none-any.whl → 2.0.5__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/core/api.py +1 -0
- simo/core/api_auth.py +4 -2
- simo/core/controllers.py +1 -0
- simo/fleet/models.py +2 -1
- simo/users/middleware.py +2 -4
- {simo-2.0.4.dist-info → simo-2.0.5.dist-info}/METADATA +1 -1
- {simo-2.0.4.dist-info → simo-2.0.5.dist-info}/RECORD +10 -10
- {simo-2.0.4.dist-info → simo-2.0.5.dist-info}/LICENSE.md +0 -0
- {simo-2.0.4.dist-info → simo-2.0.5.dist-info}/WHEEL +0 -0
- {simo-2.0.4.dist-info → simo-2.0.5.dist-info}/top_level.txt +0 -0
simo/core/api.py
CHANGED
|
@@ -14,6 +14,7 @@ from rest_framework.decorators import action
|
|
|
14
14
|
from rest_framework.response import Response as RESTResponse
|
|
15
15
|
from rest_framework.exceptions import ValidationError as APIValidationError
|
|
16
16
|
from simo.core.utils.config_values import ConfigException
|
|
17
|
+
from simo.users.middleware import introduce as introduce_user
|
|
17
18
|
from .models import (
|
|
18
19
|
Instance, Category, Zone, Component, Icon, ComponentHistory,
|
|
19
20
|
HistoryAggregate, Gateway
|
simo/core/api_auth.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import json
|
|
2
1
|
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
|
|
3
2
|
from rest_framework import HTTP_HEADER_ENCODING, exceptions
|
|
4
3
|
from simo.users.models import User
|
|
4
|
+
from simo.users.middleware import introduce as introduce_user
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class SecretKeyAuth(BasicAuthentication):
|
|
@@ -15,7 +15,7 @@ class SecretKeyAuth(BasicAuthentication):
|
|
|
15
15
|
|
|
16
16
|
if not user or not user.is_active:
|
|
17
17
|
return
|
|
18
|
-
|
|
18
|
+
introduce_user(user)
|
|
19
19
|
return (user, None)
|
|
20
20
|
|
|
21
21
|
def authenticate_header(self, request):
|
|
@@ -35,6 +35,8 @@ class IsAuthenticated(SessionAuthentication):
|
|
|
35
35
|
if not user.is_authenticated:
|
|
36
36
|
raise exceptions.NotAuthenticated()
|
|
37
37
|
|
|
38
|
+
introduce_user(user)
|
|
39
|
+
|
|
38
40
|
return (user, None)
|
|
39
41
|
|
|
40
42
|
def authenticate_header(self, request):
|
simo/core/controllers.py
CHANGED
|
@@ -222,6 +222,7 @@ class ControllerBase(ABC):
|
|
|
222
222
|
if value != self.component.value:
|
|
223
223
|
self.component.value_previous = self.component.value
|
|
224
224
|
self.component.value = value
|
|
225
|
+
|
|
225
226
|
self.component.change_init_by = None
|
|
226
227
|
self.component.change_init_date = None
|
|
227
228
|
self.component.change_init_to = None
|
simo/fleet/models.py
CHANGED
|
@@ -166,7 +166,8 @@ class Colonel(DirtyFieldsMixin, models.Model):
|
|
|
166
166
|
@transaction.atomic
|
|
167
167
|
def rebuild_occupied_pins(self):
|
|
168
168
|
for pin in ColonelPin.objects.filter(colonel=self):
|
|
169
|
-
pin.
|
|
169
|
+
pin.occupied_by_id = None
|
|
170
|
+
pin.occupied_by_content_type = None
|
|
170
171
|
pin.save()
|
|
171
172
|
|
|
172
173
|
for component in self.components.all():
|
simo/users/middleware.py
CHANGED
|
@@ -11,9 +11,8 @@ import threading
|
|
|
11
11
|
|
|
12
12
|
# We use daphne for asgi, which seems to be working fine for what we have already
|
|
13
13
|
# observed. However, this is a good candidate for reworking it in to something
|
|
14
|
-
# more
|
|
14
|
+
# more robust.
|
|
15
15
|
|
|
16
|
-
# TODO: rework this in to something more roboust
|
|
17
16
|
|
|
18
17
|
_thread_locals = threading.local()
|
|
19
18
|
|
|
@@ -39,7 +38,6 @@ class IntroduceUser:
|
|
|
39
38
|
self.get_response = get_response
|
|
40
39
|
|
|
41
40
|
def __call__(self, request):
|
|
42
|
-
response = self.get_response(request)
|
|
43
41
|
if request.user.is_authenticated:
|
|
44
42
|
introduce(request.user)
|
|
45
|
-
return
|
|
43
|
+
return self.get_response(request)
|
|
@@ -26,15 +26,15 @@ simo/_hub_template/hub/supervisor.conf,sha256=IY3fdK0fDD2eAothB0n54xhjQj8LYoXIR9
|
|
|
26
26
|
simo/_hub_template/hub/urls.py,sha256=Ydm-1BkYAzWeEF-MKSDIFf-7aE4qNLPm48-SA51XgJQ,25
|
|
27
27
|
simo/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
simo/core/admin.py,sha256=SXZlKI2aiEscDS12qXdkxDa30GNkFsgnJMT711S1wuw,17525
|
|
29
|
-
simo/core/api.py,sha256=
|
|
30
|
-
simo/core/api_auth.py,sha256=
|
|
29
|
+
simo/core/api.py,sha256=D2uX25Do7UkKaYNNY5ZIMtuet8r-_XgoEzK9324smkw,23695
|
|
30
|
+
simo/core/api_auth.py,sha256=_3hG4e1eLKrcRnSAOB_xTL6cwtOJ2_7JS7GZU_iqTgA,1251
|
|
31
31
|
simo/core/api_meta.py,sha256=li4KLFl6xTYOoD8pgS8PYcjqTZlzhXI0reAkt06PZFA,3404
|
|
32
32
|
simo/core/app_widgets.py,sha256=EEQOto3fGR0syDqpJE38tQrx8DoTTyg26nF5kYzHY38,2018
|
|
33
33
|
simo/core/auto_urls.py,sha256=0gu-IL7PHobrmKW6ksffiOkAYu-aIorykWdxRNtwGYo,1194
|
|
34
34
|
simo/core/autocomplete_views.py,sha256=JT5LA2_Wtr60XYSAIqaXFKFYPjrmkEf6yunXD9y2zco,4022
|
|
35
35
|
simo/core/base_types.py,sha256=yqbIZqBksrAkEuHRbt6iExwPDDy0K5II2NzRCkmOvMU,589
|
|
36
36
|
simo/core/context.py,sha256=98PXAMie43faRVBFkOG22uNpvGRNprcGhzjBFkrxaRY,1367
|
|
37
|
-
simo/core/controllers.py,sha256=
|
|
37
|
+
simo/core/controllers.py,sha256=paeZU6Ky2LgRTwj9nFqrgfeJ4kxWPcl95WDTf6P7jOo,27200
|
|
38
38
|
simo/core/dynamic_settings.py,sha256=U2WNL96JzVXdZh0EqMPWrxqO6BaRR2Eo5KTDqz7MC4o,1943
|
|
39
39
|
simo/core/events.py,sha256=LvtonJGNyCb6HLozs4EG0WZItnDwNdtnGQ4vTcnKvUs,4438
|
|
40
40
|
simo/core/filters.py,sha256=ghtOZcrwNAkIyF5_G9Sn73NkiI71mXv0NhwCk4IyMIM,411
|
|
@@ -10128,7 +10128,7 @@ simo/fleet/controllers.py,sha256=N8Qzdp2RPFrpZ_l9O4u8VjHWoY_WTWGg76s3V3oJqEs,139
|
|
|
10128
10128
|
simo/fleet/forms.py,sha256=HpvcdFyMl9dLNx1sEOkAkXOkYht6ku2HwWWga-PJzZQ,35067
|
|
10129
10129
|
simo/fleet/gateways.py,sha256=xFsmF_SXYXK_kMJOCHkiInPJ_0VcPWz-kJDoMup2lT8,1576
|
|
10130
10130
|
simo/fleet/managers.py,sha256=kpfvvfdH4LDxddIBDpdAb5gsVk8Gb0-L9biFcj9OFPs,807
|
|
10131
|
-
simo/fleet/models.py,sha256=
|
|
10131
|
+
simo/fleet/models.py,sha256=O0lsXRmTgPyOhpcwWeJ-2GHTNe2uFhiJy4FTW9Ljz-c,11830
|
|
10132
10132
|
simo/fleet/routing.py,sha256=cofGsVWXMfPDwsJ6HM88xxtRxHwERhJ48Xyxc8mxg5o,149
|
|
10133
10133
|
simo/fleet/serializers.py,sha256=zEpXAXxjk4Rf1JhlNnLTrs20qJggqjvIySbeHVo4Tt4,1505
|
|
10134
10134
|
simo/fleet/socket_consumers.py,sha256=xNeR1IuaBTiHO2GEXwB1_4CJ29uMlqBycIUdxGT96E8,19578
|
|
@@ -10276,7 +10276,7 @@ simo/users/api.py,sha256=xJCCj75eQXdaYfiCxxG_rMDKzEZuYuCadOhOutqX2YY,9053
|
|
|
10276
10276
|
simo/users/auth_backends.py,sha256=I5pnaTa20-Lxfw_dFG8471xDITb0_fQl1PVhJalp5vU,3992
|
|
10277
10277
|
simo/users/auto_urls.py,sha256=lcJvteBsbHQMJieZpDz-63tDYejLApqsW3CUnDakd7k,272
|
|
10278
10278
|
simo/users/dynamic_settings.py,sha256=sEIsi4yJw3kH46Jq_aOkSuK7QTfQACGUE-lkyBogCaM,570
|
|
10279
|
-
simo/users/middleware.py,sha256=
|
|
10279
|
+
simo/users/middleware.py,sha256=GMCrnWSc_2qCleyQIkfQGdL-pU-UTEcSg1wPvIKZ9uk,1210
|
|
10280
10280
|
simo/users/models.py,sha256=f59mkQBpq_fFLDUa-44b1qWleB-TvGdC1M0G67huJMg,18498
|
|
10281
10281
|
simo/users/permissions.py,sha256=IwtYS8yQdupWbYKR9VimSRDV3qCJ2jXP57Lyjpb2EQM,242
|
|
10282
10282
|
simo/users/serializers.py,sha256=yrWghK7ONxfzkjO3LbDLK1WPxsPBMYUegdm29qovjjo,2486
|
|
@@ -10343,8 +10343,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10343
10343
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10344
10344
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10345
10345
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10346
|
-
simo-2.0.
|
|
10347
|
-
simo-2.0.
|
|
10348
|
-
simo-2.0.
|
|
10349
|
-
simo-2.0.
|
|
10350
|
-
simo-2.0.
|
|
10346
|
+
simo-2.0.5.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10347
|
+
simo-2.0.5.dist-info/METADATA,sha256=aQw7niHw3pcQrYlEkzWz-SoLhr68a4It838k65sh08Q,1699
|
|
10348
|
+
simo-2.0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10349
|
+
simo-2.0.5.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10350
|
+
simo-2.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|