clear-skies 1.22.25__py3-none-any.whl → 1.22.26__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 clear-skies might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clear-skies
3
- Version: 1.22.25
3
+ Version: 1.22.26
4
4
  Summary: A framework for building backends in the cloud
5
5
  Home-page: https://github.com/cmancone/clearskies
6
6
  License: MIT
@@ -157,7 +157,7 @@ clearskies/handlers/schema_helper.py,sha256=62644USvFlZu_6tT7rb-k6t_5J3Q0uZsJwP5
157
157
  clearskies/handlers/simple_routing.py,sha256=xMVfBas51pZOP8xvDmeH6L-iO6CGIrICyT5yUYceJOs,9550
158
158
  clearskies/handlers/simple_routing_route.py,sha256=vJYksR4UPWpPsMX6DhpBtCj5gyZOIytqZL-O6FKu4_c,9271
159
159
  clearskies/handlers/simple_search.py,sha256=bSfq8rzdqkBj-dTGUBSZ1EkfjzUWHID7mKD2xEf8VzQ,6165
160
- clearskies/handlers/update.py,sha256=iqVsCp8Xhzeto6OEGgQr8A4ip636M9cEVIzvdO_zmEM,4284
160
+ clearskies/handlers/update.py,sha256=oLPHT5m1eDHfRMgVDBmN81at__dN7v7f7VVypgiGlZs,4382
161
161
  clearskies/handlers/write.py,sha256=Gu1w1PQ1F7tlqCqALorMRek3UH6IkViPIO195dxPd8k,9372
162
162
  clearskies/input_outputs/__init__.py,sha256=mQWL-u41FRTrPGuHe8FhLmcHjAEaUxjFwUf7RgDcbAs,182
163
163
  clearskies/input_outputs/cli.py,sha256=ar2TeW-24BdCRbw9JFilZyJlZ2Qg34uwluutKx1XKSA,6694
@@ -208,7 +208,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
208
208
  clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
209
209
  clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
210
210
  clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
211
- clear_skies-1.22.25.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
212
- clear_skies-1.22.25.dist-info/METADATA,sha256=npujLxw9sA0vXJAuGaLIZ03KmowdcRzVc9xz1PhF0ek,1920
213
- clear_skies-1.22.25.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
214
- clear_skies-1.22.25.dist-info/RECORD,,
211
+ clear_skies-1.22.26.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
212
+ clear_skies-1.22.26.dist-info/METADATA,sha256=742CZN85He24BzPEaI0IEF0A1wq6s0HbFGf3LyW2n6E,1920
213
+ clear_skies-1.22.26.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
214
+ clear_skies-1.22.26.dist-info/RECORD,,
@@ -55,11 +55,8 @@ class Update(Write):
55
55
  if authorization and hasattr(authorization, "filter_models"):
56
56
  models = authorization.filter_models(models, input_output.get_authorization_data(), input_output)
57
57
  model = models.first()
58
- if not model.exists:
59
- if self._configuration.get("upsert"):
60
- input_data[id_column_name] = model_id
61
- else:
62
- return self.error(input_output, "Not Found", 404)
58
+ if not model.exists and not self._configuration.get("upsert"):
59
+ return self.error(input_output, "Not Found", 404)
63
60
  if model.exists and "id" in input_data:
64
61
  del input_data["id"]
65
62
 
@@ -69,6 +66,11 @@ class Update(Write):
69
66
  }
70
67
  if input_errors:
71
68
  raise InputError(input_errors)
69
+
70
+ # if we're doing the update part of an upsert, then we have to provide the expected model id
71
+ if not model.exists:
72
+ input_data[id_column_name] = model_id
73
+
72
74
  model.save(input_data, columns=self._get_writeable_columns())
73
75
 
74
76
  return self.success(input_output, self._model_as_json(model, input_output))