zou 0.19.64__py3-none-any.whl → 0.19.65__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.64"
1
+ __version__ = "0.19.65"
@@ -2,7 +2,12 @@ from flask_restful import Resource, inputs
2
2
  from flask_jwt_extended import jwt_required
3
3
 
4
4
  from zou.app.mixin import ArgsMixin
5
- from zou.app.services import news_service, projects_service, user_service
5
+ from zou.app.services import (
6
+ news_service,
7
+ projects_service,
8
+ user_service,
9
+ persons_service,
10
+ )
6
11
  from zou.app.services.exception import NewsNotFoundException
7
12
  from zou.app.utils import permissions
8
13
 
@@ -21,6 +26,8 @@ class NewsMixin(ArgsMixin):
21
26
  before,
22
27
  ) = self.get_arguments()
23
28
 
29
+ current_user = persons_service.get_current_user_raw()
30
+
24
31
  after = self.parse_date_parameter(after)
25
32
  before = self.parse_date_parameter(before)
26
33
  result = news_service.get_last_news_for_project(
@@ -34,6 +41,7 @@ class NewsMixin(ArgsMixin):
34
41
  page_size=page_size,
35
42
  after=after,
36
43
  before=before,
44
+ current_user=current_user,
37
45
  )
38
46
  stats = news_service.get_news_stats_for_project(
39
47
  project_ids=project_ids,
@@ -44,6 +52,7 @@ class NewsMixin(ArgsMixin):
44
52
  author_id=person_id,
45
53
  after=after,
46
54
  before=before,
55
+ current_user=current_user,
47
56
  )
48
57
  result["stats"] = stats
49
58
  return result
@@ -96,6 +96,7 @@ def get_last_news_for_project(
96
96
  before=None,
97
97
  after=None,
98
98
  episode_id=None,
99
+ current_user=None,
99
100
  ):
100
101
  """
101
102
  Return last 50 news for given project. Add related information to make it
@@ -120,6 +121,9 @@ def get_last_news_for_project(
120
121
 
121
122
  if len(project_ids) > 0:
122
123
  query = query.filter(Project.id.in_(project_ids))
124
+ elif current_user is not None:
125
+ if current_user.role.code != "admin":
126
+ query = query.filter(Project.team.contains(current_user))
123
127
 
124
128
  if entity_id is not None:
125
129
  query = query.filter(Entity.id == entity_id)
@@ -239,6 +243,7 @@ def get_news_stats_for_project(
239
243
  author_id=None,
240
244
  before=None,
241
245
  after=None,
246
+ current_user=None,
242
247
  ):
243
248
  """
244
249
  Return the number of news by task status for given project and filters.
@@ -262,6 +267,9 @@ def get_news_stats_for_project(
262
267
 
263
268
  if len(project_ids) > 0:
264
269
  query = query.filter(Project.id.in_(project_ids))
270
+ elif current_user is not None:
271
+ if current_user.role.code != "admin":
272
+ query = query.filter(Project.team.contains(current_user))
265
273
 
266
274
  if task_status_id is not None:
267
275
  query = query.filter(Comment.task_status_id == task_status_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zou
3
- Version: 0.19.64
3
+ Version: 0.19.65
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=AE0rp3sVhFtsB8DowQYoE-zLLutz3QrJPjwvcxH2Z-w,24
1
+ zou/__init__.py,sha256=QymMdfW20FwDwGem8kEmAxvcXtOnqMqFF0h97OLRL2w,24
2
2
  zou/cli.py,sha256=E7rinikQMEAoSzyV4VH2IrTR4HRDBgqHAcYswEfyFnU,18893
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
4
  zou/event_stream.py,sha256=_tue9Ry3aqCniZpKGhWJaY1Eo_fd6zOAfnzPvh_mJzU,8489
@@ -85,7 +85,7 @@ zou/app/blueprints/files/resources.py,sha256=8SIV8kaqv3dxyL8nyqG3QiZmk5ZYIvUxw6k
85
85
  zou/app/blueprints/index/__init__.py,sha256=Dh3oQiirpg8RCkfVOuk3irIjSvUvuRf0jPxE6oGubz0,828
86
86
  zou/app/blueprints/index/resources.py,sha256=_JiNodmq3-XCIz4vF0MYkkkg1Wdzh7Fl19KU0TTia1M,8742
87
87
  zou/app/blueprints/news/__init__.py,sha256=HxBXjC15dVbotNAZ0CLf02iwUjxJr20kgf8_kT_9nwM,505
88
- zou/app/blueprints/news/resources.py,sha256=SL0RYo-fs23GjQU1IW4kuEBg2SHdaXaonrOoOnWafdw,7183
88
+ zou/app/blueprints/news/resources.py,sha256=5sN4iHTD3W2SEi1MhVHpeR1OjeTdW-XarkD8tyINLzU,7362
89
89
  zou/app/blueprints/persons/__init__.py,sha256=0cnHHw3K_8OEMm0qOi3wKVomSAg9IJSnVjAXabMeHks,3893
90
90
  zou/app/blueprints/persons/resources.py,sha256=0EBI6w63WhjqDSj-COYGk4NO6V1oRyAzfH4f7dXNYoE,42793
91
91
  zou/app/blueprints/playlists/__init__.py,sha256=vuEk1F3hFHsmuKWhdepMoLyOzmNKDn1YrjjfcaIz0lQ,1596
@@ -198,7 +198,7 @@ zou/app/services/file_tree_service.py,sha256=8JNBDgnXtV-AmSJ3gnUGB4oSwLjPgi1WYyL
198
198
  zou/app/services/files_service.py,sha256=df1_9v-vwE5HVi9XjtilTPWHuiWunvrwPyQh_IXupNM,28517
199
199
  zou/app/services/index_service.py,sha256=1w8rGJ7ArYC13B43hD4JOPtVhaRsbseJVVY-GnU_3tA,9874
200
200
  zou/app/services/names_service.py,sha256=TOSrintROmxcAlcFQE0i2E3PBLnw81GAztNselpTn18,2947
201
- zou/app/services/news_service.py,sha256=g-QlITBbEvhvm-pLv7GtGACKX4uBPa-IKxfNOgMgaHo,8768
201
+ zou/app/services/news_service.py,sha256=Wq262gOPP4EThXXcpT9o0QW8Z3lDQuPV6It-7IEzA5U,9116
202
202
  zou/app/services/notifications_service.py,sha256=7GDRio_mGaRYV5BHOAdpxBZjA_LLYUfVpbwZqy1n9pI,15685
203
203
  zou/app/services/persons_service.py,sha256=0CKYrmHDUq34VNNgLSWDKN37EgmD68ZqyrUmm4ABj18,16356
204
204
  zou/app/services/playlists_service.py,sha256=pAlPHET4jNdST5jsmJrFUkf1SVhfSoML9zdNpZ_88l4,32439
@@ -413,9 +413,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
413
413
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
414
414
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
415
415
  zou/utils/movie.py,sha256=u9LCEOvmkxwm-KiZ6jKNdB9LSC6XXUDwJpVx8LkDwJg,16416
416
- zou-0.19.64.dist-info/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
417
- zou-0.19.64.dist-info/METADATA,sha256=C-XgzvidRw9iFYCbEg3gXBgcVa7XVocH5OdY0dPG1Pw,6676
418
- zou-0.19.64.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
419
- zou-0.19.64.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
420
- zou-0.19.64.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
421
- zou-0.19.64.dist-info/RECORD,,
416
+ zou-0.19.65.dist-info/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
417
+ zou-0.19.65.dist-info/METADATA,sha256=z8SeZil-36Q2OV0no0X07PXuVOr-dB0J3UuvoblntMw,6676
418
+ zou-0.19.65.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
419
+ zou-0.19.65.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
420
+ zou-0.19.65.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
421
+ zou-0.19.65.dist-info/RECORD,,
File without changes
File without changes