zou 0.19.39__py3-none-any.whl → 0.19.41__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.19.39"
1
+ __version__ = "0.19.41"
@@ -60,13 +60,15 @@ class DownloadAttachmentResource(Resource):
60
60
  task = tasks_service.get_task(comment["object_id"])
61
61
  user_service.check_project_access(task["project_id"])
62
62
  user_service.check_entity_access(task["entity_id"])
63
- else:
63
+ elif attachment_file["chat_message_id"] is not None:
64
64
  message = chats_service.get_chat_message(
65
65
  attachment_file["chat_message_id"]
66
66
  )
67
67
  chat = chats_service.get_chat_by_id(message["chat_id"])
68
68
  entity = entities_service.get_entity(chat["object_id"])
69
69
  user_service.check_project_access(entity["project_id"])
70
+ else:
71
+ raise permissions.PermissionDenied()
70
72
  try:
71
73
  file_path = comments_service.get_attachment_file_path(
72
74
  attachment_file
@@ -4,6 +4,8 @@ from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
4
4
 
5
5
  from zou.app.services import chats_service, tasks_service, user_service
6
6
 
7
+ from zou.app.utils.permissions import PermissionDenied
8
+
7
9
 
8
10
  class AttachmentFilesResource(BaseModelsResource):
9
11
  def __init__(self):
@@ -16,17 +18,18 @@ class AttachmentFileResource(BaseModelResource):
16
18
 
17
19
  def check_read_permissions(self, instance):
18
20
  attachment_file = instance
19
- if attachment_file["comment_id"]:
21
+ if attachment_file["comment_id"] is not None:
20
22
  comment = tasks_service.get_comment(attachment_file["comment_id"])
21
23
  task = tasks_service.get_task(comment["object_id"])
22
24
  user_service.check_project_access(task["project_id"])
23
25
  user_service.check_entity_access(task["entity_id"])
24
- else:
26
+ elif attachment_file["chat_message_id"] is not None:
25
27
  message = chats_service.get_chat_message(
26
28
  attachment_file["chat_message_id"]
27
29
  )
28
30
  chat = chats_service.get_chat(message["chat_id"])
29
31
  print(chat)
30
32
  user_service.check_entity_access(chat["object_id"])
31
-
33
+ else:
34
+ raise PermissionDenied()
32
35
  return True
@@ -695,7 +695,7 @@ class AttachmentThumbnailResource(Resource):
695
695
  task = tasks_service.get_task(comment["object_id"])
696
696
  user_service.check_project_access(task["project_id"])
697
697
  user_service.check_entity_access(task["entity_id"])
698
- else:
698
+ elif attachment_file["chat_message_id"] is not None:
699
699
  message = chats_service.get_chat_message(
700
700
  attachment_file["chat_message_id"]
701
701
  )
@@ -703,6 +703,8 @@ class AttachmentThumbnailResource(Resource):
703
703
  entity = entities_service.get_entity(chat["object_id"])
704
704
  user_service.check_project_access(entity["project_id"])
705
705
  user_service.check_entity_access(chat["object_id"])
706
+ else:
707
+ return False
706
708
  return True
707
709
 
708
710
  @jwt_required()
@@ -136,43 +136,51 @@ def _get_comment_author(person_id):
136
136
 
137
137
 
138
138
  def _manage_status_change(task_status, task, comment):
139
- status_changed = task_status["id"] != task["task_status_id"]
140
- new_data = {
141
- "task_status_id": task_status["id"],
142
- "last_comment_date": comment["created_at"],
143
- }
144
- if status_changed:
145
- if task_status["is_retake"]:
146
- retake_count = task["retake_count"]
147
- if retake_count is None or retake_count == "NoneType":
148
- retake_count = 0
149
- new_data["retake_count"] = retake_count + 1
150
-
151
- if task_status["is_feedback_request"]:
152
- new_data["end_date"] = date_helpers.get_utc_now_datetime()
153
-
154
- if (
155
- task_status["short_name"] == "wip"
156
- and task["real_start_date"] is None
157
- ):
158
- new_data["real_start_date"] = datetime.datetime.now(
159
- datetime.timezone.utc
160
- )
139
+ is_last_comment = (
140
+ task["last_comment_date"] is None
141
+ or task["last_comment_date"] < comment["created_at"]
142
+ )
143
+ if not is_last_comment:
144
+ status_changed = False
145
+ task = tasks_service.reset_task_data(task["id"])
146
+ else:
147
+ status_changed = task_status["id"] != task["task_status_id"]
148
+ new_data = {
149
+ "task_status_id": task_status["id"],
150
+ "last_comment_date": comment["created_at"],
151
+ }
152
+ if status_changed:
153
+ if task_status["is_retake"]:
154
+ retake_count = task["retake_count"]
155
+ if retake_count is None or retake_count == "NoneType":
156
+ retake_count = 0
157
+ new_data["retake_count"] = retake_count + 1
158
+
159
+ if task_status["is_feedback_request"]:
160
+ new_data["end_date"] = date_helpers.get_utc_now_datetime()
161
+
162
+ if (
163
+ task_status["short_name"] == "wip"
164
+ and task["real_start_date"] is None
165
+ ):
166
+ new_data["real_start_date"] = datetime.datetime.now(
167
+ datetime.timezone.utc
168
+ )
161
169
 
162
- tasks_service.update_task(task["id"], new_data)
163
-
164
- if status_changed:
165
- events.emit(
166
- "task:status-changed",
167
- {
168
- "task_id": task["id"],
169
- "new_task_status_id": new_data["task_status_id"],
170
- "previous_task_status_id": task["task_status_id"],
171
- "person_id": comment["person_id"],
172
- },
173
- project_id=task["project_id"],
174
- )
175
- task.update(new_data)
170
+ tasks_service.update_task(task["id"], new_data)
171
+
172
+ if status_changed:
173
+ events.emit(
174
+ "task:status-changed",
175
+ {
176
+ "task_id": task["id"],
177
+ "new_task_status_id": new_data["task_status_id"],
178
+ "previous_task_status_id": task["task_status_id"],
179
+ "person_id": comment["person_id"],
180
+ },
181
+ project_id=task["project_id"],
182
+ )
183
+ task.update(new_data)
176
184
  return task, status_changed
177
185
 
178
186
 
@@ -1148,19 +1148,19 @@ def download_preview_background_from_another_instance(
1148
1148
  """
1149
1149
  Download all files link to preview background file entry.
1150
1150
  """
1151
- extension = preview_background.extension
1152
-
1153
1151
  preview_background_file_id = str(preview_background.id)
1154
1152
  for prefix in [
1155
1153
  "thumbnails",
1156
1154
  "preview-backgrounds",
1157
1155
  ]:
1156
+ extension = (
1157
+ "png" if prefix == "thumbnails" else preview_background.extension
1158
+ )
1158
1159
  if prefix == "preview-backgrounds":
1159
1160
  path = f"/pictures/preview-background-files/{preview_background_file_id}.{extension}"
1160
1161
  elif prefix == "thumbnails":
1161
1162
  path = f"/pictures/thumbnails/preview-background-files/{preview_background_file_id}.png"
1162
1163
 
1163
- extension = "png" if prefix == "thumbnails" else extension
1164
1164
  file_path = f"/tmp/{prefix}-{preview_background_file_id}.{extension}"
1165
1165
  download_file_from_another_instance(
1166
1166
  path,
@@ -1173,9 +1173,9 @@ def download_preview_background_from_another_instance(
1173
1173
  force,
1174
1174
  dict_errors,
1175
1175
  )
1176
- logger.info(
1177
- f"{index:0{len(str(total))}}/{total} Preview background file {preview_background_file_id} processed."
1178
- )
1176
+ logger.info(
1177
+ f"{index:0{len(str(total))}}/{total} Preview background file {preview_background_file_id} processed."
1178
+ )
1179
1179
 
1180
1180
 
1181
1181
  def download_attachment_files_from_another_instance(
@@ -1812,7 +1812,7 @@ def reset_task_data(task_id):
1812
1812
  )
1813
1813
  project_id = str(task.project_id)
1814
1814
  events.emit("task:update", {"task_id": task.id}, project_id)
1815
- return task.serialize()
1815
+ return task.serialize(relations=True)
1816
1816
 
1817
1817
 
1818
1818
  def get_persons_tasks_dates():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zou
3
- Version: 0.19.39
3
+ Version: 0.19.41
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
@@ -24,7 +24,7 @@ License-File: LICENSE
24
24
  Requires-Dist: babel ==2.15.0
25
25
  Requires-Dist: click ==8.1.7
26
26
  Requires-Dist: discord.py ==2.3.2
27
- Requires-Dist: email-validator ==2.1.1
27
+ Requires-Dist: email-validator ==2.2.0
28
28
  Requires-Dist: ffmpeg-python ==0.2.0
29
29
  Requires-Dist: fido2 ==1.1.3
30
30
  Requires-Dist: flasgger ==0.9.7.1
@@ -40,7 +40,7 @@ Requires-Dist: flask-jwt-extended ==4.6.0
40
40
  Requires-Dist: flask-migrate ==4.0.7
41
41
  Requires-Dist: flask-socketio ==5.3.6
42
42
  Requires-Dist: flask ==3.0.3
43
- Requires-Dist: gazu ==0.10.9
43
+ Requires-Dist: gazu ==0.10.10
44
44
  Requires-Dist: gevent-websocket ==0.10.1
45
45
  Requires-Dist: gevent ==24.2.1
46
46
  Requires-Dist: gunicorn ==22.0.0
@@ -49,28 +49,28 @@ Requires-Dist: itsdangerous ==2.2.0
49
49
  Requires-Dist: Jinja2 ==3.1.4
50
50
  Requires-Dist: ldap3 ==2.9.1
51
51
  Requires-Dist: matterhook ==0.2
52
- Requires-Dist: meilisearch ==0.31.2
53
- Requires-Dist: opencv-python ==4.10.0.82
52
+ Requires-Dist: meilisearch ==0.31.3
53
+ Requires-Dist: opencv-python ==4.10.0.84
54
54
  Requires-Dist: OpenTimelineIO ==0.16.0
55
- Requires-Dist: orjson ==3.10.3
55
+ Requires-Dist: orjson ==3.10.5
56
56
  Requires-Dist: pillow ==10.3.0
57
- Requires-Dist: psutil ==5.9.8
57
+ Requires-Dist: psutil ==6.0.0
58
58
  Requires-Dist: psycopg[binary] ==3.1.19
59
59
  Requires-Dist: pyotp ==2.9.0
60
60
  Requires-Dist: python-nomad ==2.0.1
61
61
  Requires-Dist: python-slugify ==8.0.4
62
- Requires-Dist: python-socketio ==5.11.2
62
+ Requires-Dist: python-socketio ==5.11.3
63
63
  Requires-Dist: pytz ==2024.1
64
- Requires-Dist: redis ==5.0.5
64
+ Requires-Dist: redis ==5.0.6
65
65
  Requires-Dist: requests ==2.32.3
66
66
  Requires-Dist: rq ==1.16.2
67
67
  Requires-Dist: slackclient ==2.9.4
68
68
  Requires-Dist: sqlalchemy-utils ==0.41.2
69
- Requires-Dist: sqlalchemy ==2.0.30
69
+ Requires-Dist: sqlalchemy ==2.0.31
70
70
  Requires-Dist: ua-parser ==0.18.0
71
71
  Requires-Dist: werkzeug ==3.0.3
72
72
  Requires-Dist: numpy ==1.24.4 ; python_version == "3.8"
73
- Requires-Dist: numpy ==1.26.4 ; python_version >= "3.9"
73
+ Requires-Dist: numpy ==2.0.0 ; python_version >= "3.9"
74
74
  Provides-Extra: dev
75
75
  Requires-Dist: wheel ; extra == 'dev'
76
76
  Provides-Extra: lint
@@ -80,7 +80,7 @@ Requires-Dist: pre-commit ==3.7.1 ; (python_version >= "3.9") and extra == 'lint
80
80
  Provides-Extra: monitoring
81
81
  Requires-Dist: prometheus-flask-exporter ==0.23.0 ; extra == 'monitoring'
82
82
  Requires-Dist: pygelf ==0.4.2 ; extra == 'monitoring'
83
- Requires-Dist: sentry-sdk ==2.5.0 ; extra == 'monitoring'
83
+ Requires-Dist: sentry-sdk ==2.6.0 ; extra == 'monitoring'
84
84
  Provides-Extra: prod
85
85
  Requires-Dist: gunicorn ; extra == 'prod'
86
86
  Requires-Dist: gevent ; extra == 'prod'
@@ -1,4 +1,4 @@
1
- zou/__init__.py,sha256=LE4pg4oO9YkOg9Q9t1uDXO9-QKb1HTG_hkao-rhuIAs,24
1
+ zou/__init__.py,sha256=dgzwiYNneoa6Prr4yKokUkQAc0JeTED_l3OscWCs9CM,24
2
2
  zou/cli.py,sha256=mnY9MoD0SjY4KFa1qyYS4E5bjEqk1UIZpH0iYeZPGh8,17508
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
4
  zou/event_stream.py,sha256=zgob2dZKray2lxPa11hdRNmOg8XRlKDdRcGdF80ylwg,8245
@@ -18,12 +18,12 @@ zou/app/blueprints/breakdown/resources.py,sha256=JY3j17kv7xPKV9S-XoOxNYivpGHlfZk
18
18
  zou/app/blueprints/chats/__init__.py,sha256=YGmwGvddg3MgSYVIh-hmkX8t2em9_LblxBeJzFqFJD4,558
19
19
  zou/app/blueprints/chats/resources.py,sha256=1THB-UNgMcedspNfB9-3-Tsr6rJ_PUl6Y2s_y0Ww0jk,5910
20
20
  zou/app/blueprints/comments/__init__.py,sha256=WqpJ7-_dK1cInGTFJAxQ7syZtPCotwq2oO20UEnk1h4,1532
21
- zou/app/blueprints/comments/resources.py,sha256=wtFRE94g_ivTAw0uknUG0b_lZPhUUpAeb4u2c5BZeaM,19161
21
+ zou/app/blueprints/comments/resources.py,sha256=nKR_2XsxKIqmqpkf5LBI23O55t0JRc22q4Ow9Ue8gjM,19271
22
22
  zou/app/blueprints/concepts/__init__.py,sha256=sP_P4mfYvfMcgeE6MHZYP3eD0Lz0Lwit5-CFuVnA-Jg,894
23
23
  zou/app/blueprints/concepts/resources.py,sha256=maJNrBAWX0bKbDKtOZc3YFp4nTVtIdkkAA4H9WA9n1Y,10140
24
24
  zou/app/blueprints/crud/__init__.py,sha256=qn7xkEh2EG0mPS_RBmm0GgYr0O1jnmI8ymXZnFWZCz8,8361
25
25
  zou/app/blueprints/crud/asset_instance.py,sha256=va3mw79aPKry2m9PYAmjVePTScigewDjwD1c672f0y0,1335
26
- zou/app/blueprints/crud/attachment_file.py,sha256=k1S9CdGU7TdMbpt12fnaO6-24LIYtSQJs5FGwGhRyLw,1181
26
+ zou/app/blueprints/crud/attachment_file.py,sha256=FJA5nKli-9l4p-Mka-tNRNRFil6dNC7QMN3N2MBBN_w,1346
27
27
  zou/app/blueprints/crud/base.py,sha256=nz1-iOyxPPzkF0bivlgQ-bubUfxmiwsLd9pX9kLHr54,16005
28
28
  zou/app/blueprints/crud/chat.py,sha256=Sq1r0y9ANjS113PUpwgAhnjYsxxLKMCM-a7DJ_icF00,344
29
29
  zou/app/blueprints/crud/chat_message.py,sha256=bEEUoV0sNzu5sntNS6fpLh5NC6wWiycWCXtTE-t4yG4,387
@@ -91,7 +91,7 @@ zou/app/blueprints/persons/resources.py,sha256=-5J8ZswusYEBTNmX4I7fLFDZVMKyO0qhO
91
91
  zou/app/blueprints/playlists/__init__.py,sha256=vuEk1F3hFHsmuKWhdepMoLyOzmNKDn1YrjjfcaIz0lQ,1596
92
92
  zou/app/blueprints/playlists/resources.py,sha256=alRlMHypUFErXLsEYxpFK84cdjFJ3YWwamZtW0KcwLY,17211
93
93
  zou/app/blueprints/previews/__init__.py,sha256=CazwYCIg-iGSLcOH2NYcgflH7zipHfCF9MD1fP93mOI,4363
94
- zou/app/blueprints/previews/resources.py,sha256=DRxnhXgAKIEyRWQ0WhisS5h45OhabLVfQ16rlBl9Cmc,48241
94
+ zou/app/blueprints/previews/resources.py,sha256=wteYWoD_Rdp3z7D3TQxk_3sC4KkqighYpm86R6vNa5A,48327
95
95
  zou/app/blueprints/projects/__init__.py,sha256=Pn3fA5bpNFEPBzxTKJ2foV6osZFflXXSM2l2uZh3ktM,3927
96
96
  zou/app/blueprints/projects/resources.py,sha256=v9_TLh3mujL-p7QcGkfSOJnNojzoJA15jhqAHz5kEIc,31552
97
97
  zou/app/blueprints/search/__init__.py,sha256=QCjQIY_85l_orhdEiqav_GifjReuwsjZggN3V0GeUVY,356
@@ -185,7 +185,7 @@ zou/app/services/backup_service.py,sha256=_ZtZp6wkcVYnHxBosziwLGdrTvsUttXGphiydq
185
185
  zou/app/services/base_service.py,sha256=OZd0STFh-DyBBdwsmA7DMMnrwv4C8wJUbShvZ1isndU,1383
186
186
  zou/app/services/breakdown_service.py,sha256=p93HncjC36qbmvZiB259QGRtciS37N-s_7IWVAQx5eE,26727
187
187
  zou/app/services/chats_service.py,sha256=V1RmQeQnsH1xvtbs6wcjEpudQS547eJBM7bgJr9-qYM,8270
188
- zou/app/services/comments_service.py,sha256=d7-St48KSl4gH4EFzrXoWmGHpXUpQgQ-QdB_9cVGWZs,18215
188
+ zou/app/services/comments_service.py,sha256=87UXq8zPfx-oDQzcHXR-REzNUbHAIxuLwpp6jRU6kHQ,18606
189
189
  zou/app/services/concepts_service.py,sha256=KGvk6lF5udj3SWn40X9KE8OAigrLCZUKEz9_CW7EMgQ,11440
190
190
  zou/app/services/custom_actions_service.py,sha256=fWISEOOdthadrxeHuacEel5Xj6msn0yWXJQDG1gzvsY,297
191
191
  zou/app/services/deletion_service.py,sha256=ddaup7i_CTugcJDrynczNcfhjSKgDeGhPQjQ68We_l8,17255
@@ -209,8 +209,8 @@ zou/app/services/schedule_service.py,sha256=E99HKYsXgnK2sw58fw-NNHXWBgVJiA60upzt
209
209
  zou/app/services/shots_service.py,sha256=3L5lhmwPudQ8R40hYopx4cn8OxEy0HWYQ-2yrRITV9I,47921
210
210
  zou/app/services/stats_service.py,sha256=cAlc92i9d6eYtsuwe3hYHYwdytg8KEMi1-TADfysJwM,11733
211
211
  zou/app/services/status_automations_service.py,sha256=tVio7Sj7inhvKS4UOyRhcdpwr_KNP96hT1o0X7XcGF4,715
212
- zou/app/services/sync_service.py,sha256=vjqX6u7ra-jbBlglftThYokbThSeJyeMFw1GtHkOxGY,41769
213
- zou/app/services/tasks_service.py,sha256=L9wIhk-QHm7sS3e_yQQDHcMiimyrA2u55XfZS_76Zu0,67783
212
+ zou/app/services/sync_service.py,sha256=gtYRSTK3GzraMEETErW9g_dog9BlXkBg1OZ2VnpC7s4,41754
213
+ zou/app/services/tasks_service.py,sha256=05Vy7cBhHFr7PYBuTNiggw1TydtOhP5ekuBoTZLTLOA,67797
214
214
  zou/app/services/telemetry_services.py,sha256=xQm1h1t_JxSFW59zQGf4NuNdUi1UfMa_6pQ-ytRbmGA,1029
215
215
  zou/app/services/time_spents_service.py,sha256=TBLC1O9Dg_UbciG5Nw-dejqX2-5n6q44lACeN6OnUkQ,15206
216
216
  zou/app/services/user_service.py,sha256=BiOhPV7O-vowet7jOksjXk2V4yxZkdqsIyNboJ-Oz_A,46595
@@ -405,9 +405,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
405
405
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
406
406
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
407
  zou/utils/movie.py,sha256=u9LCEOvmkxwm-KiZ6jKNdB9LSC6XXUDwJpVx8LkDwJg,16416
408
- zou-0.19.39.dist-info/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
409
- zou-0.19.39.dist-info/METADATA,sha256=Arhapd-NWzlG_MMeTPe4OVRgAyHo6xks7zVwrTEVqaY,6678
410
- zou-0.19.39.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
411
- zou-0.19.39.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
412
- zou-0.19.39.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
413
- zou-0.19.39.dist-info/RECORD,,
408
+ zou-0.19.41.dist-info/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
409
+ zou-0.19.41.dist-info/METADATA,sha256=1FpQO4yRb6Vnjh-WRIRJHy5oomUM079NszNxHU8P1BM,6678
410
+ zou-0.19.41.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
411
+ zou-0.19.41.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
412
+ zou-0.19.41.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
413
+ zou-0.19.41.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes