Exemplo n.º 1
0
 def delete(self):
     """Unarchive a post (only for moderators and admins)"""
     try:
         new_status = PostStatus[request.args.get('status', '')]
         if new_status == PostStatus.archived:
             raise KeyError
     except KeyError:
         return abort(400, "Incorrect status value")
     return post_service.set_post_status(get_jwt_identity(),
                                         get_uuid(request), new_status), 201
Exemplo n.º 2
0
 def post(self):
     """Approve a post (only for moderators and admins)"""
     return post_service.set_post_status(get_jwt_identity(),
                                         get_uuid(request),
                                         PostStatus.posted), 201
Exemplo n.º 3
0
 def post(self):
     """Return a post for further improvements (only for moderators and admins)"""
     return post_service.set_post_status(
         get_jwt_identity(), get_uuid(request),
         PostStatus.returned_for_improvement), 201
Exemplo n.º 4
0
 def delete(self):
     """Disapprove a post (only for moderators and admins)"""
     return post_service.set_post_status(
         get_jwt_identity(), get_uuid(request),
         PostStatus.under_consideration), 201