Exemple #1
0
 def get(self):
     """Get posts of given types and statuses by given subunit or whole organization (only for admins and moderators)"""
     statuses_raw = query_param_to_set("statuses")
     statuses = set()
     for status in statuses_raw:
         if status:
             try:
                 statuses.add(PostStatus[status])
             except KeyError:
                 abort(422, f"Incorrect status value '{status}'")
     return post_service.get_all_posts(get_jwt_identity(),
                                       get_page(request),
                                       statuses,
                                       reverse=(request.args.get(
                                           'reverse',
                                           'true') == 'true')), 200
Exemple #2
0
 def get(self):
     """Get archived posts"""
     return post_service.get_archived_posts(get_page(request)), 200
Exemple #3
0
 def get(self):
     """Get announcements feed of the subunit"""
     return post_service.get_feed(PostType.subunit_announcement,
                                  get_page(request), get_uuid(request)), 200
Exemple #4
0
 def get(self):
     """Get announcements feed of all organization"""
     return post_service.get_feed(PostType.organization_announcement,
                                  get_page(request)), 200
Exemple #5
0
 def get(self):
     """Get news feed of the subunit"""
     return post_service.get_feed(PostType.subunit_news, get_page(request),
                                  get_uuid(request)), 200
Exemple #6
0
 def get(self):
     """Get news feed of all organization"""
     return post_service.get_feed(PostType.organization_news,
                                  get_page(request)), 200
Exemple #7
0
 def get(self):
     """Get list of employee`s attachments"""
     return attachment_service.get_all_attachments(get_uuid(request),
                                                   get_page(request)), 200