zou 0.20.58__py3-none-any.whl → 0.20.60__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.58"
1
+ __version__ = "0.20.60"
@@ -28,8 +28,8 @@ class ScheduleItemResource(BaseModelResource):
28
28
  BaseModelResource.__init__(self, ScheduleItem)
29
29
 
30
30
  def check_update_permissions(self, instance, data):
31
- return user_service.check_supervisor_schedule_item_access(
32
- instance, data
31
+ return user_service.check_supervisor_project_task_type_access(
32
+ instance["project_id"], instance["task_type_id"]
33
33
  )
34
34
 
35
35
  def update_data(self, data, instance_id):
@@ -9,12 +9,22 @@ from zou.app.services import (
9
9
  shots_service,
10
10
  tasks_service,
11
11
  persons_service,
12
+ user_service,
12
13
  )
13
14
 
14
15
  from zou.app.utils import date_helpers
15
16
 
16
17
 
17
18
  class TaskTypeEstimationsCsvImportResource(BaseCsvProjectImportResource):
19
+ """
20
+ Import the estimations of task-types for given project.
21
+ """
22
+
23
+ def check_permissions(self, project_id, task_type, episode_id=None):
24
+ return user_service.check_supervisor_project_task_type_access(
25
+ project_id, task_type["id"]
26
+ )
27
+
18
28
  def post(self, project_id, task_type_id, episode_id=None):
19
29
  """
20
30
  Import the estimations of task-types for given project.
@@ -99,3 +99,14 @@ class PreviewFile(db.Model, BaseMixin, SerializerMixin):
99
99
  "created_at": self.created_at,
100
100
  }
101
101
  )
102
+
103
+ def present_minimal(self):
104
+ return fields.serialize_dict(
105
+ {
106
+ "id": self.id,
107
+ "name": self.name,
108
+ "extension": self.extension,
109
+ "revision": self.revision,
110
+ "position": self.position,
111
+ }
112
+ )
@@ -169,6 +169,7 @@ def get_last_news_for_project(
169
169
  Task.entity_id,
170
170
  PreviewFile.extension,
171
171
  PreviewFile.annotations,
172
+ PreviewFile.revision,
172
173
  Entity.preview_file_id,
173
174
  )
174
175
 
@@ -187,6 +188,7 @@ def get_last_news_for_project(
187
188
  task_entity_id,
188
189
  preview_file_extension,
189
190
  preview_file_annotations,
191
+ preview_file_revision,
190
192
  entity_preview_file_id,
191
193
  ) in news_list:
192
194
  full_entity_name, episode_id, _ = names_service.get_full_entity_name(
@@ -206,7 +208,7 @@ def get_last_news_for_project(
206
208
  "task_entity_id": task_entity_id,
207
209
  "preview_file_id": news.preview_file_id,
208
210
  "preview_file_extension": preview_file_extension,
209
- "preview_file_annotations": preview_file_annotations,
211
+ "preview_file_revision": preview_file_revision,
210
212
  "project_id": project_id,
211
213
  "project_name": project_name,
212
214
  "created_at": news.created_at,
@@ -217,6 +219,30 @@ def get_last_news_for_project(
217
219
  }
218
220
  )
219
221
  )
222
+
223
+ if only_preview:
224
+ task_ids = [
225
+ news["task_id"] for news in result if news["task_id"] is not None
226
+ ]
227
+ revisions = [news["preview_file_revision"] for news in result]
228
+ preview_files = (
229
+ PreviewFile.query.filter(PreviewFile.task_id.in_(task_ids))
230
+ .filter(PreviewFile.revision.in_(revisions))
231
+ .order_by(
232
+ PreviewFile.task_id, PreviewFile.revision, PreviewFile.position
233
+ )
234
+ )
235
+ preview_files_map = {}
236
+ for preview_file in preview_files:
237
+ key = f"{str(preview_file.task_id)}-{preview_file.revision}"
238
+ if not key in preview_files_map:
239
+ preview_files_map[key] = []
240
+ preview_files_map[key].append(preview_file.present_minimal())
241
+
242
+ for entry in result:
243
+ key = f"{entry['task_id']}-{entry['preview_file_revision']}"
244
+ entry["preview_files"] = preview_files_map[key]
245
+
220
246
  return {
221
247
  "data": result,
222
248
  "total": total,
@@ -519,8 +519,31 @@ def check_task_action_access(task_id):
519
519
  ]
520
520
  in user["departments"]
521
521
  )
522
- else:
523
- is_allowed = False
522
+
523
+ if not is_allowed:
524
+ raise permissions.PermissionDenied
525
+ return is_allowed
526
+
527
+
528
+ def check_supervisor_project_task_type_access(project_id, task_type_id):
529
+ """
530
+ Return true if current user can have access to a task type.
531
+ """
532
+ is_allowed = False
533
+ if permissions.has_admin_permissions() or (
534
+ permissions.has_manager_permissions()
535
+ and check_belong_to_project(project_id)
536
+ ):
537
+ is_allowed = True
538
+ elif permissions.has_supervisor_permissions() and check_belong_to_project(
539
+ project_id
540
+ ):
541
+ user = persons_service.get_current_user(relations=True)
542
+ is_allowed = (
543
+ user["departments"] == []
544
+ or tasks_service.get_task_type(task_type_id)["department_id"]
545
+ in user["departments"]
546
+ )
524
547
 
525
548
  if not is_allowed:
526
549
  raise permissions.PermissionDenied
@@ -664,38 +687,6 @@ def check_supervisor_task_access(task, new_data={}):
664
687
  return is_allowed
665
688
 
666
689
 
667
- def check_supervisor_schedule_item_access(schedule_item, new_data={}):
668
- """
669
- Return true if current user is a manager and has a task assigned related
670
- to the project of this task or is a supervisor and can modify data accorded
671
- to his departments
672
- """
673
- is_allowed = False
674
- if permissions.has_admin_permissions() or (
675
- permissions.has_manager_permissions()
676
- and check_belong_to_project(schedule_item["project_id"])
677
- ):
678
- is_allowed = True
679
- elif permissions.has_supervisor_permissions() and check_belong_to_project(
680
- schedule_item["project_id"]
681
- ):
682
- user_departments = persons_service.get_current_user(relations=True)[
683
- "departments"
684
- ]
685
- if (
686
- user_departments == []
687
- or tasks_service.get_task_type(schedule_item["task_type_id"])[
688
- "department_id"
689
- ]
690
- in user_departments
691
- ):
692
- is_allowed = True
693
-
694
- if not is_allowed:
695
- raise permissions.PermissionDenied
696
- return is_allowed
697
-
698
-
699
690
  def check_metadata_department_access(entity, new_data={}):
700
691
  """
701
692
  Return true if current user is a manager and has a task assigned for this
zou/event_stream.py CHANGED
@@ -267,7 +267,6 @@ def on_change_version(data):
267
267
  emit("preview-room:comparison-panzoom-changed", data, room=room_id)
268
268
 
269
269
 
270
-
271
270
  if __name__ == "__main__":
272
271
  socketio.run(
273
272
  app,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 0.20.58
3
+ Version: 0.20.60
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
@@ -49,13 +49,12 @@ Requires-Dist: Jinja2==3.1.6
49
49
  Requires-Dist: ldap3==2.9.1
50
50
  Requires-Dist: matterhook==0.2
51
51
  Requires-Dist: meilisearch==0.36.0
52
- Requires-Dist: numpy==2.2.6; python_version == "3.10"
53
- Requires-Dist: numpy==2.3.1; python_version >= "3.11"
54
- Requires-Dist: opencv-python==4.11.0.86
52
+ Requires-Dist: numpy==2.2.6
53
+ Requires-Dist: opencv-python==4.12.0.88
55
54
  Requires-Dist: OpenTimelineIO==0.17.0
56
55
  Requires-Dist: OpenTimelineIO-Plugins==0.17.0
57
56
  Requires-Dist: orjson==3.10.18
58
- Requires-Dist: pillow==11.2.1
57
+ Requires-Dist: pillow==11.3.0
59
58
  Requires-Dist: psutil==7.0.0
60
59
  Requires-Dist: psycopg[binary]==3.2.9
61
60
  Requires-Dist: pyotp==2.9.0
@@ -69,7 +68,7 @@ Requires-Dist: requests==2.32.4
69
68
  Requires-Dist: rq==2.4.0
70
69
  Requires-Dist: semver==3.0.4
71
70
  Requires-Dist: slackclient==2.9.4
72
- Requires-Dist: spdx-license-list==3.26.0
71
+ Requires-Dist: spdx-license-list==3.27.0
73
72
  Requires-Dist: sqlalchemy_utils==0.41.2
74
73
  Requires-Dist: sqlalchemy==2.0.41
75
74
  Requires-Dist: tabulate==0.9.0
@@ -1,7 +1,7 @@
1
- zou/__init__.py,sha256=5N6GyHyKynWvCcfY7xFn4CwfJiEcy8iljLFjtzWXQ-0,24
1
+ zou/__init__.py,sha256=8OpoYx3Rq00iLT1VQD4WsjWu5M2FZ-ZO7V7xTgrBfnA,24
2
2
  zou/cli.py,sha256=W7nhMII-gyl8AlL6zgDmverSdFphDV_WnuN3BHrHc8w,22448
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
- zou/event_stream.py,sha256=YOWVGAgseVQKC6usoYDW4T9iRVrG7R8TvP-Nr2AKi6k,8576
4
+ zou/event_stream.py,sha256=9O1PE_vDW8p3yfHJNSZ8w0ybD-660x8oGN0izgJdTjM,8575
5
5
  zou/job_settings.py,sha256=_aqBhujt2Q8sXRWIbgbDf-LUdXRdBimdtTc-fZbiXoY,202
6
6
  zou/app/__init__.py,sha256=zGmaBGBHSS_Px34I3_WZmcse62G_AZJArjm4F6TwmRk,7100
7
7
  zou/app/api.py,sha256=Esgni_0-tAaE3msWxNMEdUS_wwIdElM0P2GrjhaHbCk,3727
@@ -53,7 +53,7 @@ zou/app/blueprints/crud/preview_file.py,sha256=c-WTDdSbeXmlQalW0s0bTTgixD-tvfV0K
53
53
  zou/app/blueprints/crud/project.py,sha256=g8kWGzgWyVk7s6Y-41DRAGjIegxS36W4SbP1FMJTQDM,8428
54
54
  zou/app/blueprints/crud/project_status.py,sha256=XIiIsAfaD5sLZA6wT3UL4FZQpnoOcqPzYfFIWrp9Svs,540
55
55
  zou/app/blueprints/crud/salary_scale.py,sha256=CLvY6DJhSaOZnSqzyLwrEmqRb7Hru2qDC4iB0bKM168,2436
56
- zou/app/blueprints/crud/schedule_item.py,sha256=1dbNKbftNG3if38Hzh1uslCAu3BE4jOqWhLV0590A90,1400
56
+ zou/app/blueprints/crud/schedule_item.py,sha256=O5qPiFw4D1z_E8df7Xtst9k1Hc3RUcOiKbc7YG4PB2E,1438
57
57
  zou/app/blueprints/crud/search_filter.py,sha256=qR0crZFfaOd2YxFcPMKhAj1SXCc-YW9Wk4UA07dDgMQ,393
58
58
  zou/app/blueprints/crud/search_filter_group.py,sha256=bdCLP1EmSatSNQXW8qYjqXQ1_dqluxUeEe7wEpcP_R0,424
59
59
  zou/app/blueprints/crud/software.py,sha256=oKFINQh3DcVTd0Ap_cvgsgvhrIbGPjVBKucwkRpcI3Q,1974
@@ -112,7 +112,7 @@ zou/app/blueprints/source/csv/casting.py,sha256=zUlwEnSheoCMTIgvRlKJgNv3hYPDjfSr
112
112
  zou/app/blueprints/source/csv/edits.py,sha256=yL1RcClBxPNakLt326M2aJk6pVv0H7CrNXALuKHkDZ8,8386
113
113
  zou/app/blueprints/source/csv/persons.py,sha256=QciJ47B3rAPyUQTAeToCUAhEai16J4s37oOErjdC_Vw,2582
114
114
  zou/app/blueprints/source/csv/shots.py,sha256=5OI0IBY8C72aBbDFrIkvN-ZkWWCHsvOGUQ0Z9rWsnDs,9748
115
- zou/app/blueprints/source/csv/task_type_estimations.py,sha256=L4urkpixLQv3wqpZKgJl8QcNz30D1ZW6OAr-pytnau8,6205
115
+ zou/app/blueprints/source/csv/task_type_estimations.py,sha256=pFH1kwW5OyElDFc9RtTFLZBgv1bB4oN7dfJJ7DtER9Q,6495
116
116
  zou/app/blueprints/source/shotgun/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
117
  zou/app/blueprints/source/shotgun/assets.py,sha256=vuRvy0oUszImYRawrbWC2h7CHYSBvGXDJPoa6ZqpG_U,4980
118
118
  zou/app/blueprints/source/shotgun/base.py,sha256=Y0sX8X3oN0AQWiBqjLX-cijnBZH8UzZp4iC8BQpf_tk,6193
@@ -169,7 +169,7 @@ zou/app/models/person.py,sha256=xRjoPL2OayjmwUJcvbD7BJY7atxm-daIzPfEhgr5LbU,8107
169
169
  zou/app/models/playlist.py,sha256=YGgAk84u0_fdIEY02Dal4kfk8APVZvWFwWYV74qvrio,1503
170
170
  zou/app/models/plugin.py,sha256=zNs9Qi1h_v_6edZs5GHRSKItaAG4Gnlk1FQKumiiv68,766
171
171
  zou/app/models/preview_background_file.py,sha256=j8LgRmY7INnlB07hFwwB-8ssQrRC8vsb8VcpsTbt6tA,559
172
- zou/app/models/preview_file.py,sha256=eDPXw0QIdJze_E4kAS8SsyabrefWhIIdwuGmjss7iXo,3282
172
+ zou/app/models/preview_file.py,sha256=ofN0aTvjc7eYBMj7OjUs3Yhw9_HZGOYB9ftbH3XAVCM,3587
173
173
  zou/app/models/project.py,sha256=mXoLK7fEwDRGd21AoQadgV9K0AgoxYwTb5Sdf_cezlY,9203
174
174
  zou/app/models/project_status.py,sha256=pExaHH7x4Eu8xOqD3_mRRbMzjT2jJZ8rm-9jo7yUGXA,390
175
175
  zou/app/models/salary_scale.py,sha256=3TaOtgJkGq2sPUAmE9nbzAqgkPzZYiSLZw-YSv-oLyc,814
@@ -207,7 +207,7 @@ zou/app/services/file_tree_service.py,sha256=8JNBDgnXtV-AmSJ3gnUGB4oSwLjPgi1WYyL
207
207
  zou/app/services/files_service.py,sha256=df1_9v-vwE5HVi9XjtilTPWHuiWunvrwPyQh_IXupNM,28517
208
208
  zou/app/services/index_service.py,sha256=IaffQz_oj6GPEbuDp4a2qnSc6n-hhIcmA_LrTm3Wots,10201
209
209
  zou/app/services/names_service.py,sha256=TOSrintROmxcAlcFQE0i2E3PBLnw81GAztNselpTn18,2947
210
- zou/app/services/news_service.py,sha256=eOXkvLhOcgncI2NrgiJEccV28oxZX5CsZVqaE-l4kWQ,9084
210
+ zou/app/services/news_service.py,sha256=uYzk8PwJ6khWy6OCnTFx4Su5yQkPXMJ5Qu4MSDDFj8U,10097
211
211
  zou/app/services/notifications_service.py,sha256=7GDRio_mGaRYV5BHOAdpxBZjA_LLYUfVpbwZqy1n9pI,15685
212
212
  zou/app/services/persons_service.py,sha256=HjV-su80Y2BO9l5zoBKHMNF0mDGtkWqPhEOs3nQ3nlI,16566
213
213
  zou/app/services/playlists_service.py,sha256=IKjvT3RZigwXsrhsRFqaWWlm-tZSN6-jgMDf0Hn3w3Q,33179
@@ -223,7 +223,7 @@ zou/app/services/sync_service.py,sha256=iWxx1kOGEXympHmSBBQWtDZWNtumdxp8kppee0Oe
223
223
  zou/app/services/tasks_service.py,sha256=gRD-xODi7tCAyHdi5yJohKavWdODK6TwvDGR9pa82BM,69831
224
224
  zou/app/services/telemetry_services.py,sha256=xQm1h1t_JxSFW59zQGf4NuNdUi1UfMa_6pQ-ytRbmGA,1029
225
225
  zou/app/services/time_spents_service.py,sha256=8sYnepgeo4yohNFRNiEedqFfL2vuJ78GZSHOpRmp52Q,16502
226
- zou/app/services/user_service.py,sha256=wdi2b2kvct5b_Qi9XdrNEhz9JL4WoI9EpT-8_UOSXnE,52070
226
+ zou/app/services/user_service.py,sha256=VaxYb8tmsNCyIDiKwneSCX-6BnLBElGxQwYPvkcjM2k,51774
227
227
  zou/app/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
228
228
  zou/app/stores/auth_tokens_store.py,sha256=-qOJPybLHvnMOq3PWk073OW9HJwOHGhFLZeOIlX1UVw,1290
229
229
  zou/app/stores/file_store.py,sha256=yLQDM6mNbj9oe0vsWdBqun7D8Dw-eSjD1yHCCftX0OI,4045
@@ -447,9 +447,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
447
447
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
448
448
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
449
449
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
450
- zou-0.20.58.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
451
- zou-0.20.58.dist-info/METADATA,sha256=4RwRbOeyIMqXRm-G7TvNpWKYSYLrM2gM0IHrcsaGtPA,6778
452
- zou-0.20.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
453
- zou-0.20.58.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
454
- zou-0.20.58.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
455
- zou-0.20.58.dist-info/RECORD,,
450
+ zou-0.20.60.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
451
+ zou-0.20.60.dist-info/METADATA,sha256=UGpY4_MFusHKn9eLGc0oAbc9g7X48ViObYsUAOHhMJ0,6698
452
+ zou-0.20.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
453
+ zou-0.20.60.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
454
+ zou-0.20.60.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
455
+ zou-0.20.60.dist-info/RECORD,,
File without changes