zou 1.0.1__py3-none-any.whl → 1.0.3__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__ = "1.0.1"
1
+ __version__ = "1.0.3"
@@ -1,10 +1,11 @@
1
1
  from flask_jwt_extended import jwt_required
2
2
 
3
3
  from zou.app.models.playlist import Playlist
4
- from zou.app.services import user_service, playlists_service
4
+ from zou.app.models.build_job import BuildJob
5
+ from zou.app.services import user_service, playlists_service, persons_service
5
6
 
6
7
  from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
7
- from zou.app.utils import fields
8
+ from zou.app.utils import fields, permissions
8
9
 
9
10
 
10
11
  class PlaylistsResource(BaseModelsResource):
@@ -169,6 +170,7 @@ class PlaylistsResource(BaseModelsResource):
169
170
  data["task_type_id"]
170
171
  ):
171
172
  data["task_type_id"] = None
173
+ data["created_by"] = persons_service.get_current_user()["id"]
172
174
  return data
173
175
 
174
176
 
@@ -353,12 +355,23 @@ class PlaylistResource(BaseModelResource):
353
355
  400:
354
356
  description: Integrity error or cannot delete
355
357
  """
356
- playlists_service.remove_playlist(instance_id)
357
- return "", 204
358
+ return super().delete(instance_id)
359
+
360
+ def pre_delete(self, playlist):
361
+ query = BuildJob.query.filter_by(playlist_id=playlist["id"])
362
+ for job in query.all():
363
+ playlists_service.remove_build_job(playlist, job.id)
358
364
 
359
365
  def check_update_permissions(self, playlist, data):
360
- user_service.check_project_access(playlist["project_id"])
361
- user_service.block_access_to_vendor()
366
+ if user_service.has_manager_project_access(playlist["project_id"]):
367
+ return True
368
+ elif permissions.has_supervisor_permissions() and (
369
+ playlist["created_by"]
370
+ in [None, persons_service.get_current_user()["id"]]
371
+ ):
372
+ return True
373
+ else:
374
+ raise permissions.PermissionDenied()
362
375
 
363
376
  def pre_update(self, instance_dict, data):
364
377
  if "shots" in data:
@@ -372,3 +385,14 @@ class PlaylistResource(BaseModelResource):
372
385
  ]
373
386
  data["shots"] = shots
374
387
  return data
388
+
389
+ def check_delete_permissions(self, playlist):
390
+ if user_service.has_manager_project_access(playlist["project_id"]):
391
+ return True
392
+ elif permissions.has_supervisor_permissions() and (
393
+ playlist["created_by"]
394
+ in [None, persons_service.get_current_user()["id"]]
395
+ ):
396
+ return True
397
+ else:
398
+ raise permissions.PermissionDenied()
@@ -2681,6 +2681,7 @@ class SetTaskMainPreviewResource(Resource):
2681
2681
  preview_file = preview_files_service.get_last_preview_file_for_task(
2682
2682
  task_id
2683
2683
  )
2684
+ entity = None
2684
2685
  if preview_file is not None:
2685
2686
  entity = entities_service.update_entity_preview(
2686
2687
  task["entity_id"], preview_file["id"]
@@ -30,6 +30,12 @@ class Playlist(db.Model, BaseMixin, SerializerMixin):
30
30
 
31
31
  build_jobs = relationship("BuildJob")
32
32
 
33
+ created_by = db.Column(
34
+ UUIDType(binary=False),
35
+ db.ForeignKey("person.id"),
36
+ nullable=True,
37
+ )
38
+
33
39
  __table_args__ = (
34
40
  db.UniqueConstraint(
35
41
  "name", "project_id", "episode_id", name="playlist_uc"
@@ -0,0 +1,36 @@
1
+ """add created_by field to playlists
2
+
3
+ Revision ID: a0f668430352
4
+ Revises: a1b2c3d4e5f6
5
+ Create Date: 2025-12-03 12:10:52.626583
6
+
7
+ """
8
+ from alembic import op
9
+ import sqlalchemy as sa
10
+ import sqlalchemy_utils
11
+ import sqlalchemy_utils
12
+ import uuid
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision = 'a0f668430352'
16
+ down_revision = 'a1b2c3d4e5f6'
17
+ branch_labels = None
18
+ depends_on = None
19
+
20
+
21
+ def upgrade():
22
+ # ### commands auto generated by Alembic - please adjust! ###
23
+ with op.batch_alter_table('playlist', schema=None) as batch_op:
24
+ batch_op.add_column(sa.Column('created_by', sqlalchemy_utils.types.uuid.UUIDType(binary=False), default=uuid.uuid4, nullable=True))
25
+ batch_op.create_foreign_key(None, 'person', ['created_by'], ['id'])
26
+
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade():
31
+ # ### commands auto generated by Alembic - please adjust! ###
32
+ with op.batch_alter_table('playlist', schema=None) as batch_op:
33
+ batch_op.drop_constraint(None, type_='foreignkey')
34
+ batch_op.drop_column('created_by')
35
+
36
+ # ### end Alembic commands ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 1.0.1
3
+ Version: 1.0.3
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
@@ -56,16 +56,16 @@ Requires-Dist: OpenTimelineIO-Plugins==0.18.1
56
56
  Requires-Dist: orjson==3.11.4
57
57
  Requires-Dist: pillow==12.0.0
58
58
  Requires-Dist: psutil==7.1.3
59
- Requires-Dist: psycopg[binary]==3.2.12
59
+ Requires-Dist: psycopg[binary]==3.2.13
60
60
  Requires-Dist: pyotp==2.9.0
61
61
  Requires-Dist: pysaml2==7.5.4
62
62
  Requires-Dist: python-nomad==2.1.0
63
63
  Requires-Dist: python-slugify==8.0.4
64
- Requires-Dist: python-socketio==5.14.3
64
+ Requires-Dist: python-socketio==5.15.0
65
65
  Requires-Dist: pytz==2025.2
66
66
  Requires-Dist: redis==5.2.1
67
67
  Requires-Dist: requests==2.32.5
68
- Requires-Dist: rq==2.6.0
68
+ Requires-Dist: rq==2.6.1
69
69
  Requires-Dist: semver==3.0.4
70
70
  Requires-Dist: slackclient==2.9.4
71
71
  Requires-Dist: spdx-license-list==3.27.0
@@ -88,11 +88,11 @@ Requires-Dist: pytest==9.0.1; extra == "test"
88
88
  Provides-Extra: monitoring
89
89
  Requires-Dist: prometheus-flask-exporter==0.23.2; extra == "monitoring"
90
90
  Requires-Dist: pygelf==0.4.3; extra == "monitoring"
91
- Requires-Dist: sentry-sdk==2.45.0; extra == "monitoring"
91
+ Requires-Dist: sentry-sdk==2.46.0; extra == "monitoring"
92
92
  Provides-Extra: lint
93
93
  Requires-Dist: autoflake==2.3.1; extra == "lint"
94
94
  Requires-Dist: black==25.11.0; extra == "lint"
95
- Requires-Dist: pre-commit==4.4.0; extra == "lint"
95
+ Requires-Dist: pre-commit==4.5.0; extra == "lint"
96
96
  Dynamic: license-file
97
97
  Dynamic: requires-python
98
98
 
@@ -1,4 +1,4 @@
1
- zou/__init__.py,sha256=d4QHYmS_30j0hPN8NmNPnQ_Z0TphDRbu4MtQj9cT9e8,22
1
+ zou/__init__.py,sha256=2plzdEEb24FLjE2I2XyBBcJEPYWHccNL4SgtLC_6erg,22
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
@@ -47,7 +47,7 @@ zou/app/blueprints/crud/organisation.py,sha256=zrLy9Zr8oIvXKTgxd_DNKtC8FNzfEm6hH
47
47
  zou/app/blueprints/crud/output_file.py,sha256=UBlI75wHY94ej2xBeSsECHd7ru4la2KsrIn6S2b5P1E,4939
48
48
  zou/app/blueprints/crud/output_type.py,sha256=MijUbT4-hyFiM_VEUj5LwRNLW_6DI8zc7UaPKg1kLyg,2789
49
49
  zou/app/blueprints/crud/person.py,sha256=3NHEDZGNSUqNIPLMiAeXSV1Tzny5SIuATa3uaqLA8yc,23771
50
- zou/app/blueprints/crud/playlist.py,sha256=U0WNX3fLfYEavuPjYYJ4LKZ5sep1JCtrP4g4tKVUlI0,12538
50
+ zou/app/blueprints/crud/playlist.py,sha256=JGVGzcfCDmtp_NDs8C5Agl23Qsny0ATGIP5KVHcx4Rk,13505
51
51
  zou/app/blueprints/crud/plugin.py,sha256=dPlII76DQv9ucpz7dLiIdt6arYfACmhHtCRDGRTdTQ0,8752
52
52
  zou/app/blueprints/crud/preview_background_file.py,sha256=z1BDSmf1gapaZgOWhGNkcmmNsLJLmh69xsRzDvXGU7g,11346
53
53
  zou/app/blueprints/crud/preview_file.py,sha256=yyGe45-8PiBIKHUT564NHnmHndaxVk3YJj-cgwPRgHY,13081
@@ -135,7 +135,7 @@ zou/app/blueprints/source/shotgun/tasks.py,sha256=neAgM5ARMjxWUZc0i8DuMt2kll4qS7
135
135
  zou/app/blueprints/source/shotgun/team.py,sha256=rZUgE-P7uUi8SJf2LhNS0ZPnu2RXpnIaBWjG3caCcRY,6334
136
136
  zou/app/blueprints/source/shotgun/versions.py,sha256=eYghDZtkGK76z6pL_ZwZFHT1eYE9CPLpMB9SwmyD7tM,7775
137
137
  zou/app/blueprints/tasks/__init__.py,sha256=udtTZJVViawRAPu8dO_OoyVzQTheLYWTHeTnrC-2RDA,4331
138
- zou/app/blueprints/tasks/resources.py,sha256=FQL1k-BBvKwxaKjSLKBGF-BQblFATdyXpV3HE8Dg7c0,101255
138
+ zou/app/blueprints/tasks/resources.py,sha256=y4wXvi3y0UJObvfTN6Zk2n64CAu2tqYymbmXYOxgmns,101277
139
139
  zou/app/blueprints/user/__init__.py,sha256=H9zCHcVobC6jq6dTToXKAjnZmDA0a9gChHiIP3BcZsc,4586
140
140
  zou/app/blueprints/user/resources.py,sha256=7nNkgVsZOCGLwlKCdtnVdkJGoCBjMGawGCFjFo26i1o,123927
141
141
  zou/app/file_trees/default.json,sha256=ryUrEmQYE8B_WkzCoQLgmem3N9yNwMIWx9G8p3HfG9o,2310
@@ -171,7 +171,7 @@ zou/app/models/organisation.py,sha256=R69AR1JDZSs6YeXDalmz3ewmrSMDv9Mr8AZAHn09Iu
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
173
  zou/app/models/person.py,sha256=GhjiXxOXMPdeDHArTbbZDQt-9LLtJpq_HFF-7WVRlaM,8047
174
- zou/app/models/playlist.py,sha256=YGgAk84u0_fdIEY02Dal4kfk8APVZvWFwWYV74qvrio,1503
174
+ zou/app/models/playlist.py,sha256=bae19fczYpdBFbYMVPraQZ3XuqeW2_vQFlMuodrHlbo,1629
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
177
177
  zou/app/models/preview_file.py,sha256=ofN0aTvjc7eYBMj7OjUs3Yhw9_HZGOYB9ftbH3XAVCM,3587
@@ -400,6 +400,7 @@ zou/migrations/versions/9bd17364fc18_.py,sha256=nruaGMczzkWkya_D11QEU3uiU1UVEUIt
400
400
  zou/migrations/versions/9d3bb33c6fc6_add_department_keys_to_filter_models.py,sha256=xUd0OIqp0q9l-pC6wCn2tfgCi6maeud6jf1CYGCHnxA,2084
401
401
  zou/migrations/versions/9e5b3a9b0cee_add_new_column_metadatadescriptor_data_type_.py,sha256=HT34AjM9yN1IvLrCzx4-YOiocFDnPQ-FJ05icPCBnNo,5517
402
402
  zou/migrations/versions/9f8445f9b42c_add_man_days_fields.py,sha256=muFsM2g_m-L5Zss36roTsjCoSDdhu_e4hVQntiNHyiY,828
403
+ zou/migrations/versions/a0f668430352_add_created_by_field_to_playlists.py,sha256=lrAzEPD57OAji4zZmyN42iCTA1sr8-4y-HbXy4nhobg,1070
403
404
  zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py,sha256=6WLafF57oAI80tc0qZUzoHJ86poyMXcOTzzuFsLNgEM,728
404
405
  zou/migrations/versions/a23682ccc1f1_.py,sha256=dVOUWldUZyLuLc6_HrgKUI5XH5-6Vjwai6Ew9kygkHw,1663
405
406
  zou/migrations/versions/a252a094e977_add_descriptions_for_entities_tasks_and_.py,sha256=T6V1n09fUAsZNiCYh0zwi2B6ZtCBPOdXDixqdunDI54,1012
@@ -474,9 +475,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
474
475
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
475
476
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
476
477
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
477
- zou-1.0.1.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
478
- zou-1.0.1.dist-info/METADATA,sha256=dRTFpihE95yrbS6FCbCvz0KMIyByWRZUze7yDdDuBeg,6695
479
- zou-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
480
- zou-1.0.1.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
481
- zou-1.0.1.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
482
- zou-1.0.1.dist-info/RECORD,,
478
+ zou-1.0.3.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
479
+ zou-1.0.3.dist-info/METADATA,sha256=rFFzVXfuB7IqirHHztqP8hMLdzfEHVZ8SbhsMFZuVaY,6695
480
+ zou-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
481
+ zou-1.0.3.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
482
+ zou-1.0.3.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
483
+ zou-1.0.3.dist-info/RECORD,,
File without changes