simo 2.5.10__py3-none-any.whl → 2.5.11__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 CHANGED
@@ -175,10 +175,10 @@ def get_components_queryset(instance, user):
175
175
  c_ids.add(state['id'])
176
176
 
177
177
  user_role = user.get_role(instance)
178
-
179
- for cp in user_role.component_permissions.all():
180
- if cp.read:
181
- c_ids.add(cp.component.id)
178
+ if user_role:
179
+ for cp in user_role.component_permissions.all():
180
+ if cp.read:
181
+ c_ids.add(cp.component.id)
182
182
 
183
183
  return qs.filter(id__in=c_ids).select_related(
184
184
  'zone', 'category', 'icon'
@@ -134,6 +134,8 @@ class ComponentAutocomplete(autocomplete.Select2QuerySetView):
134
134
  return qs.distinct()
135
135
 
136
136
  def get_result_label(self, item):
137
+ if self.request.META.get('HTTP_USER_AGENT') == 'SIMO-app':
138
+ return super().get_result_label(item)
137
139
  return render_to_string(
138
140
  'core/object_acutocomplete_select_item.html', {
139
141
  'object': item
simo/generic/forms.py CHANGED
@@ -271,7 +271,7 @@ class PresenceLightingConfigForm(BaseComponentForm):
271
271
  ['lights', 'on_value', 'off_value', 'presence_sensors',
272
272
  'act_on', 'hold_time', 'conditions', 'autostart', 'keep_alive']
273
273
  )
274
- if self.instance.pk:
274
+ if self.instance.pk and 'log' in self.fields:
275
275
  prefix = get_script_prefix()
276
276
  if prefix == '/':
277
277
  prefix = ''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.5.10
3
+ Version: 2.5.11
4
4
  Summary: Smart Home on Steroids!
5
5
  Author-email: Simanas Venčkauskas <simanas@simo.io>
6
6
  Project-URL: Homepage, https://simo.io
@@ -33,13 +33,13 @@ simo/backups/migrations/__pycache__/0004_alter_backup_options_alter_backuplog_op
33
33
  simo/backups/migrations/__pycache__/__init__.cpython-38.pyc,sha256=Lz1fs6V05h2AoxTOLNye0do9bEMnyuaXB_hHOjG5-HU,172
34
34
  simo/core/__init__.py,sha256=_s2TjJfQImsMrTIxqLAx9AZie1Ojmm6sCHASdl3WLGU,50
35
35
  simo/core/admin.py,sha256=5mi0Qe9TM-OILCxbcRfGJvq397QCPxjYX30K3CIZrPs,18133
36
- simo/core/api.py,sha256=A8P47OFFcqw-AXQPF3XqIV3pshEyqQGwLdM8aByddns,28288
36
+ simo/core/api.py,sha256=KIy7mpNbMWKtNPrcnbzeHXmPRboF5RPxmi_NssJXkQk,28317
37
37
  simo/core/api_auth.py,sha256=vCxvczA8aWNcW0VyKs5WlC_ytlqeGP_H_hkKUNVkCwM,1247
38
38
  simo/core/api_meta.py,sha256=EaiY-dCADP__9MvLpoHvhjytFT92IrxPZDv95xgqasU,4955
39
39
  simo/core/app_widgets.py,sha256=VxZzapuc-a29wBH7JzpvNF2SK1ECrgNUySId5ke1ffc,2509
40
40
  simo/core/apps.py,sha256=CsqpiQerhmrMsH-wGiG-gQgXd9qEkIi-LUaA9cXpKSw,425
41
41
  simo/core/auto_urls.py,sha256=nNXEgLAAAQAhRWQDA9AbDtw-zcPKmu_pufJaSa8g818,1102
42
- simo/core/autocomplete_views.py,sha256=JT5LA2_Wtr60XYSAIqaXFKFYPjrmkEf6yunXD9y2zco,4022
42
+ simo/core/autocomplete_views.py,sha256=NEzZ27h5VRWqipwYdKrxlGl7GCaA_i8ho2nibpS6FiQ,4139
43
43
  simo/core/base_types.py,sha256=WypW8hTfzveuTQtruGjLYAGQZIuczxTlW-SdRk3iQug,666
44
44
  simo/core/context.py,sha256=snfPIGcZQTrx8iiZc5PI91A0dRQH6y5kH4uG_lfhU6Q,1486
45
45
  simo/core/controllers.py,sha256=JvXdwXD7iotA7fIjZmBVshKLQGSt9Na48FMAyHRDh84,35615
@@ -10337,7 +10337,7 @@ simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10337
10337
  simo/generic/app_widgets.py,sha256=vwYYVRKzKZ9XTvWTfEbaH4zpoHiDIHP6qFTNgZI-xvY,979
10338
10338
  simo/generic/base_types.py,sha256=Bvf3lv6PXx_SwtwBH7qpkwysWuloNcKNRh3LiuZf-Dc,359
10339
10339
  simo/generic/controllers.py,sha256=kGYdcuU7kpbhb6QeuOo4l-W82Zldh8vpdMnJRMKCkgU,49378
10340
- simo/generic/forms.py,sha256=oAvWeYzLyWiNLRnXGa2124ICRD7GpLwwsF6i6L56HCI,29044
10340
+ simo/generic/forms.py,sha256=vXQ7bQV4SmYx5hbCIZFvCYZ3rJJfx4SpDJgNy8sCioE,29069
10341
10341
  simo/generic/gateways.py,sha256=dUzRBxVDdsx70mrCvxSQwhJr0ydQ5NtoLHoYeVLJmtA,15224
10342
10342
  simo/generic/models.py,sha256=Adq7ipWK-renxJlNW-SZnAq2oGEOwKx8EdUWaKnfcVQ,7597
10343
10343
  simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
@@ -10551,9 +10551,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
10551
10551
  simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10552
10552
  simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10553
10553
  simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10554
- simo-2.5.10.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10555
- simo-2.5.10.dist-info/METADATA,sha256=c5kqqHmuLRew5BhrH8PMdeuw6jE_D0ehl-R0xv0Guk0,1924
10556
- simo-2.5.10.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10557
- simo-2.5.10.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10558
- simo-2.5.10.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10559
- simo-2.5.10.dist-info/RECORD,,
10554
+ simo-2.5.11.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10555
+ simo-2.5.11.dist-info/METADATA,sha256=EA87aQ2mip3VAeGWmYPF2WzEPLqpjFR_cu7NSzd2XtE,1924
10556
+ simo-2.5.11.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10557
+ simo-2.5.11.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10558
+ simo-2.5.11.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10559
+ simo-2.5.11.dist-info/RECORD,,
File without changes