zou 0.20.74__py3-none-any.whl → 0.20.76__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.
zou/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.20.74"
1
+ __version__ = "0.20.76"
@@ -202,11 +202,6 @@ class WorkingFileFileResource(Resource):
202
202
 
203
203
 
204
204
  class WorkingFilePathResource(Resource, ArgsMixin):
205
- """
206
- Generate from file tree template a working file path based on several
207
- parameters: task, software, mode, revision and separator. Revision can be
208
- computed automatically as next revision if not given.
209
- """
210
205
 
211
206
  @jwt_required()
212
207
  def post(self, task_id):
@@ -215,7 +210,7 @@ class WorkingFilePathResource(Resource, ArgsMixin):
215
210
  ---
216
211
  tags:
217
212
  - Files
218
- description: Generate file path based on several parameters: task, software, mode, revision and separator.
213
+ description: Generate file path based on several parameters
219
214
  Revision can be computed automatically as next revision if not given.
220
215
  parameters:
221
216
  - in: path
@@ -338,12 +333,6 @@ class WorkingFilePathResource(Resource, ArgsMixin):
338
333
 
339
334
 
340
335
  class EntityOutputFilePathResource(Resource, ArgsMixin):
341
- """
342
- Generate from file tree template an output file path based on several
343
- parameters: entity, output type, task type, revision, mode, name
344
- and separator. Revision can be computed automatically as next revision if
345
- not given.
346
- """
347
336
 
348
337
  @jwt_required()
349
338
  def post(self, entity_id):
@@ -352,7 +341,7 @@ class EntityOutputFilePathResource(Resource, ArgsMixin):
352
341
  ---
353
342
  tags:
354
343
  - Files
355
- description: Generate file path based on several parameters: entity, output type, task type, revision, mode, name and separator.
344
+ description: Generate file path based on several parameters entity, output type, task type, revision, mode, name and separator.
356
345
  Revision can be computed automatically as next revision if not given.
357
346
  parameters:
358
347
  - in: path
@@ -474,11 +463,6 @@ class EntityOutputFilePathResource(Resource, ArgsMixin):
474
463
 
475
464
 
476
465
  class InstanceOutputFilePathResource(Resource, ArgsMixin):
477
- """
478
- Generate from file tree template an output file path based on several
479
- parameters: asset instance, output type, task type, revision, mode, name and separator.
480
- Revision can be computed automatically as next revision in case no revision is given in parameter.
481
- """
482
466
 
483
467
  @jwt_required()
484
468
  def post(self, asset_instance_id, temporal_entity_id):
@@ -487,7 +471,7 @@ class InstanceOutputFilePathResource(Resource, ArgsMixin):
487
471
  ---
488
472
  tags:
489
473
  - Files
490
- description: "Generate file path based on several parameters: asset instance, output type, task type, revision, mode, name and separator.
474
+ description: "Generate file path based on several parameters asset instance, output type, task type, revision, mode, name and separator.
491
475
  Revision can be computed automatically as next revision in case no revision is given in parameter."
492
476
  parameters:
493
477
  - in: path
@@ -991,17 +975,6 @@ class CommentWorkingFileResource(Resource, ArgsMixin):
991
975
 
992
976
 
993
977
  class NewEntityOutputFileResource(Resource, ArgsMixin):
994
- """
995
- Output files are linked to entities. Each time a CG artist is satisfied
996
- by what he did on a working file, he can create an output file that
997
- will be linked to a target entity (an asset, a shot, a sequence, ...).
998
- It keeps track of the working file at the origin of the output file.
999
- An output type is required for better categorization (textures, caches,
1000
- ...). A task type can be set too to give the department related to the
1001
- output file.
1002
-
1003
- Revision is automatically set.
1004
- """
1005
978
 
1006
979
  @jwt_required()
1007
980
  def post(self, entity_id):
@@ -2602,4 +2575,4 @@ class GuessFromPathResource(Resource, ArgsMixin):
2602
2575
  },
2603
2576
  ["sep", "/"],
2604
2577
  ]
2605
- )
2578
+ )
@@ -2159,12 +2159,21 @@ class ProductionDayOffsResource(Resource, ArgsMixin):
2159
2159
  '400':
2160
2160
  description: Invalid date range parameters
2161
2161
  """
2162
- user_service.check_manager_project_access(project_id)
2162
+ user_service.check_project_access(project_id)
2163
+ if (
2164
+ permissions.has_client_permissions()
2165
+ or permissions.has_vendor_permissions()
2166
+ ):
2167
+ raise permissions.PermissionDenied
2163
2168
  arguments = self.get_args(["start_date", "end_date"])
2164
2169
  start_date, end_date = arguments["start_date"], arguments["end_date"]
2165
2170
  try:
2166
2171
  return time_spents_service.get_day_offs_between_for_project(
2167
- project_id, start_date, end_date
2172
+ project_id,
2173
+ start_date,
2174
+ end_date,
2175
+ safe=permissions.has_manager_permissions(),
2176
+ current_user_id=persons_service.get_current_user()["id"],
2168
2177
  )
2169
2178
  except WrongDateFormatException:
2170
2179
  abort(
@@ -1232,9 +1232,9 @@ class TaskSubscribeResource(Resource):
1232
1232
  tags:
1233
1233
  - User
1234
1234
  description: It applies to given task and current user. When a user
1235
- subscribed, he gets notified everytime a comment is posted on the task.
1236
- When a user subscribes, he gets notified everytime a
1237
- comment is posted on the task.
1235
+ subscribed, he gets notified everytime a comment is posted on the
1236
+ task. When a user subscribes, he gets notified everytime a comment
1237
+ is posted on the task.
1238
1238
  parameters:
1239
1239
  - in: path
1240
1240
  name: task_id
zou/app/models/day_off.py CHANGED
@@ -19,3 +19,6 @@ class DayOff(db.Model, BaseMixin, SerializerMixin):
19
19
  db.UniqueConstraint("person_id", "date", name="day_off_uc"),
20
20
  db.CheckConstraint("date <= end_date", name="day_off_date_check"),
21
21
  )
22
+
23
+ def serialize_safe(self, **kwargs):
24
+ return self.serialize(ignored_attrs=["description"], **kwargs)
zou/app/models/person.py CHANGED
@@ -183,24 +183,25 @@ class Person(db.Model, BaseMixin, SerializerMixin):
183
183
  for credential in self.fido_credentials
184
184
  ]
185
185
 
186
- def serialize(
187
- self, obj_type="Person", relations=False, milliseconds=False
188
- ):
189
- data = SerializerMixin.serialize(
190
- self, obj_type, relations=relations, milliseconds=milliseconds
191
- )
192
- data["fido_devices"] = self.fido_devices()
186
+ def serialize(self, **kwargs):
187
+ data = super().serialize(**kwargs)
188
+ if "fido_devices" not in kwargs.get("ignored_attrs", []):
189
+ data["fido_devices"] = self.fido_devices()
193
190
  return data
194
191
 
195
- def serialize_safe(self, relations=False, milliseconds=False):
196
- data = self.serialize(relations=relations, milliseconds=milliseconds)
197
- del data["password"]
198
- del data["totp_secret"]
199
- del data["email_otp_secret"]
200
- del data["otp_recovery_codes"]
201
- del data["fido_credentials"]
202
- del data["jti"]
203
- return data
192
+ def serialize_safe(self, **kwargs):
193
+ return self.serialize(
194
+ ignored_attrs=[
195
+ "password",
196
+ "totp_secret",
197
+ "email_otp_secret",
198
+ "otp_recovery_codes",
199
+ "fido_credentials",
200
+ "fido_devices",
201
+ "jti",
202
+ ],
203
+ **kwargs,
204
+ )
204
205
 
205
206
  def present_minimal(self, relations=False, milliseconds=False):
206
207
  data = SerializerMixin.serialize(
@@ -606,7 +606,11 @@ def get_project_task_type_time_spents(
606
606
 
607
607
 
608
608
  def get_day_offs_between_for_project(
609
- project_id, start_date=None, end_date=None
609
+ project_id,
610
+ start_date=None,
611
+ end_date=None,
612
+ safe=False,
613
+ current_user_id=None,
610
614
  ):
611
615
  """
612
616
  Get all day off entries for project, start and end date.
@@ -627,8 +631,12 @@ def get_day_offs_between_for_project(
627
631
 
628
632
  result = defaultdict(list)
629
633
  for day_off in days_offs:
630
- result[str(day_off.person_id)].append(day_off.serialize())
631
-
634
+ day_off_person_id = str(day_off.person_id)
635
+ result[day_off_person_id].append(
636
+ day_off.serialize_safe()
637
+ if safe and current_user_id != day_off_person_id
638
+ else day_off.serialize()
639
+ )
632
640
  except DataError:
633
641
  raise WrongDateFormatException
634
642
  return dict(result)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 0.20.74
3
+ Version: 0.20.76
4
4
  Summary: API to store and manage the data of your animation production
5
5
  Home-page: https://zou.cg-wire.com
6
6
  Author: CG Wire
@@ -1,4 +1,4 @@
1
- zou/__init__.py,sha256=XfPpnxKnarguaQf3OrkgE_t9bFlmoaJ40CFc2Edn8bo,24
1
+ zou/__init__.py,sha256=oQkI2-XLYe_07NDsHHivOsyhCx9KoY1Lb6Q3c4NO25Q,24
2
2
  zou/cli.py,sha256=N9FyrL4TDgIiCUa-I3xIzOgiVLM14kz8_QLQ48y51oE,22767
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
4
  zou/event_stream.py,sha256=9O1PE_vDW8p3yfHJNSZ8w0ybD-660x8oGN0izgJdTjM,8575
@@ -89,7 +89,7 @@ zou/app/blueprints/export/csv/task_types.py,sha256=PCEEhOQcdOJv_38i-KNxbkGeNzmQ8
89
89
  zou/app/blueprints/export/csv/tasks.py,sha256=CHFcs9S3eLIz6psE6Q6mZ-OSur_GrpBeLn98Nh9NNcA,4121
90
90
  zou/app/blueprints/export/csv/time_spents.py,sha256=yYPtilOxfQD5mBwyh9h-PbTQBpab-vMrec35tYUw4fQ,2984
91
91
  zou/app/blueprints/files/__init__.py,sha256=7Wty30JW2OXIn-tBFXOWWmPuHnsnxPpH3jNtHvvr9tY,3987
92
- zou/app/blueprints/files/resources.py,sha256=G2Xal8di3LFTETT54VqOGEzXYObsln4oc3L-Lf8FpRY,84021
92
+ zou/app/blueprints/files/resources.py,sha256=c8QF_D9sC9xmz14hX4EquGB7119tz7r8N8LJS28-GuM,82692
93
93
  zou/app/blueprints/index/__init__.py,sha256=Dh3oQiirpg8RCkfVOuk3irIjSvUvuRf0jPxE6oGubz0,828
94
94
  zou/app/blueprints/index/resources.py,sha256=nLLrFK-gJv0S_eDVPOS36xFes_3MjT3vGqDQHbI5kPk,14728
95
95
  zou/app/blueprints/news/__init__.py,sha256=HxBXjC15dVbotNAZ0CLf02iwUjxJr20kgf8_kT_9nwM,505
@@ -101,7 +101,7 @@ zou/app/blueprints/playlists/resources.py,sha256=dD50WpKkIyaDar4nfYS2GfC_5e8mncV
101
101
  zou/app/blueprints/previews/__init__.py,sha256=ihC6OQ9AUjnZ2JeMnjRh_tKGO0UmAjOwhZnOivc3BnQ,4460
102
102
  zou/app/blueprints/previews/resources.py,sha256=mRFVMl4fi4mptE1qMG68GAIg868HMiE7AFnQYnszSAU,53345
103
103
  zou/app/blueprints/projects/__init__.py,sha256=ZX59ZmMIAI11zNy_RjLacOQnEcSJdwRIr68KwOYiB2k,5918
104
- zou/app/blueprints/projects/resources.py,sha256=BrPwUtiMAsk8Lozph5gNHV42mj3_RIN-1iG20bp2P88,64602
104
+ zou/app/blueprints/projects/resources.py,sha256=a3Il_DHOEx9zauUf-ifvnJADC1-KRllHvFIP5RILurM,64933
105
105
  zou/app/blueprints/search/__init__.py,sha256=QCjQIY_85l_orhdEiqav_GifjReuwsjZggN3V0GeUVY,356
106
106
  zou/app/blueprints/search/resources.py,sha256=XhNewgF4y0Tj9TIZt-2b0c5Whu43YsoeLuNZG2EHFg4,4797
107
107
  zou/app/blueprints/shots/__init__.py,sha256=EcG9qmAchlucqg1M6-RqWGfuKpa5Kq6RgyLZNSsjUr4,4225
@@ -137,7 +137,7 @@ zou/app/blueprints/source/shotgun/versions.py,sha256=8Mb35e5p3FLbbiu6AZb9tJErDKz
137
137
  zou/app/blueprints/tasks/__init__.py,sha256=udtTZJVViawRAPu8dO_OoyVzQTheLYWTHeTnrC-2RDA,4331
138
138
  zou/app/blueprints/tasks/resources.py,sha256=WVNu30pj5snz1TXjla5ZzED2CkToTNAsmJF0RcYnYBk,62938
139
139
  zou/app/blueprints/user/__init__.py,sha256=H9zCHcVobC6jq6dTToXKAjnZmDA0a9gChHiIP3BcZsc,4586
140
- zou/app/blueprints/user/resources.py,sha256=kyNfqkMhAQ286fQmhHV2bM5Vl9kk7Wv_52cRwxo2gpM,49508
140
+ zou/app/blueprints/user/resources.py,sha256=JE6i2znUUXYdl2yeI0hrkF1p6RqgYjrCb9-RmSK809Q,49517
141
141
  zou/app/file_trees/default.json,sha256=ryUrEmQYE8B_WkzCoQLgmem3N9yNwMIWx9G8p3HfG9o,2310
142
142
  zou/app/file_trees/simple.json,sha256=VBI43Z3rjQxtTpVCq3ktUgS0UB8x-aTowKL9LXuXCFI,3149
143
143
  zou/app/indexer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -154,7 +154,7 @@ zou/app/models/chat_message.py,sha256=8w7xtoqCW_CRoGKrF4ba5w-oyAHIRh-2ms3p5sQQor
154
154
  zou/app/models/comment.py,sha256=aDi64Yny5RvlSDace5ydUqxI7_hhugBVnO6EvR19tAE,6040
155
155
  zou/app/models/custom_action.py,sha256=wx5ASKJ2oG-ivASZbVf1nLiL7zELgQBJ8U1jDdvGkuU,578
156
156
  zou/app/models/data_import_error.py,sha256=dCyzaX0KATa0F8h5V3sTPlXz-XNl1VNkflRfJuaCmsg,425
157
- zou/app/models/day_off.py,sha256=WMZs7oMhUBpMnNyvhgpl1j6egZ5J0drnrF1dH3N5cII,691
157
+ zou/app/models/day_off.py,sha256=pG5EKnohhdTkYgSQl4h1CrGQ6Woa8b-DGmS-DL5q7pw,803
158
158
  zou/app/models/department.py,sha256=j8nxMJRE6wvqlDY68uPRephQTSny4sr06qs0wbzlkzc,2095
159
159
  zou/app/models/desktop_login_log.py,sha256=fdgqEXAQkHw6CtRU_Y-CuboaZA9QWJc9OzklvbdPBJY,546
160
160
  zou/app/models/entity.py,sha256=-pW30_KWeKll5fTrLBAQ_O24KxUL6G5E8cj6xUAY8M8,8569
@@ -170,7 +170,7 @@ zou/app/models/notification.py,sha256=1ODOymGPeB4oxgX_3WhOgIL_Lsz-JR7miDkBS6W8t_
170
170
  zou/app/models/organisation.py,sha256=R69AR1JDZSs6YeXDalmz3ewmrSMDv9Mr8AZAHn09Iu0,1365
171
171
  zou/app/models/output_file.py,sha256=hyLGrpsgrk0aisDXppRQrB7ItCwyuyw-X0ZwVAHabsA,2569
172
172
  zou/app/models/output_type.py,sha256=us_lCUCEvuP4vi_XmmOcEl1J2MtZhMX5ZheBqEFCgWA,381
173
- zou/app/models/person.py,sha256=EiyzAQAZ3jypRXBIAIYCexv7AacqA9JUe5rODsLUxPo,8114
173
+ zou/app/models/person.py,sha256=GhjiXxOXMPdeDHArTbbZDQt-9LLtJpq_HFF-7WVRlaM,8047
174
174
  zou/app/models/playlist.py,sha256=YGgAk84u0_fdIEY02Dal4kfk8APVZvWFwWYV74qvrio,1503
175
175
  zou/app/models/plugin.py,sha256=zNs9Qi1h_v_6edZs5GHRSKItaAG4Gnlk1FQKumiiv68,766
176
176
  zou/app/models/preview_background_file.py,sha256=j8LgRmY7INnlB07hFwwB-8ssQrRC8vsb8VcpsTbt6tA,559
@@ -229,7 +229,7 @@ zou/app/services/status_automations_service.py,sha256=tVio7Sj7inhvKS4UOyRhcdpwr_
229
229
  zou/app/services/sync_service.py,sha256=iWxx1kOGEXympHmSBBQWtDZWNtumdxp8kppee0OefMo,41811
230
230
  zou/app/services/tasks_service.py,sha256=ZLUi6_XhLU_SLwERFHx4QwcXdS-ncrVH_rIl-Lt-9yE,69993
231
231
  zou/app/services/telemetry_services.py,sha256=xQm1h1t_JxSFW59zQGf4NuNdUi1UfMa_6pQ-ytRbmGA,1029
232
- zou/app/services/time_spents_service.py,sha256=h3YlhAAhfAxijmQe-32p2qZNu4h5J3lIh8fOjV0uy4Y,18394
232
+ zou/app/services/time_spents_service.py,sha256=E0RU5dcoME1MZrxohKWmRMDTD_irwT8HUUhXHeR7kng,18635
233
233
  zou/app/services/user_service.py,sha256=inFNPsAb11odskiidXAOzNGlY5S2DvFYuYCeGGN_1lc,52990
234
234
  zou/app/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
235
235
  zou/app/stores/auth_tokens_store.py,sha256=-qOJPybLHvnMOq3PWk073OW9HJwOHGhFLZeOIlX1UVw,1290
@@ -469,9 +469,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
469
469
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
470
470
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
471
471
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
472
- zou-0.20.74.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
473
- zou-0.20.74.dist-info/METADATA,sha256=JHbyHNZzhvDcMKA0cso9abXsl70PRr8G5WD9mdd-IPc,6698
474
- zou-0.20.74.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
475
- zou-0.20.74.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
476
- zou-0.20.74.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
477
- zou-0.20.74.dist-info/RECORD,,
472
+ zou-0.20.76.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
473
+ zou-0.20.76.dist-info/METADATA,sha256=MiayTBOvOTGmdM4CrpPqkuCD1wfcH6J9LoUqcRaxCjs,6698
474
+ zou-0.20.76.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
475
+ zou-0.20.76.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
476
+ zou-0.20.76.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
477
+ zou-0.20.76.dist-info/RECORD,,
File without changes