File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 22from flask_jwt import current_identity as current_user , _jwt_required
33from flask_rest_jsonapi import ResourceDetail , ResourceList , ResourceRelationship
44
5+ from app .api .bootstrap import api
56from app .api .helpers .db import safe_query
67from app .api .helpers .exceptions import ForbiddenException , ConflictException
78from app .api .helpers .permission_manager import has_access
@@ -81,6 +82,7 @@ class UserFavouriteEventDetail(ResourceDetail):
8182 """
8283
8384 methods = ['GET' , 'DELETE' ]
85+ decorators = (api .has_permission ('is_user_itself' ),)
8486 schema = UserFavouriteEventSchema
8587 data_layer = {'session' : db .session ,
8688 'model' : UserFavouriteEvent ,
Original file line number Diff line number Diff line change @@ -4371,7 +4371,7 @@ def favourite_event_details_get(transaction):
43714371 :return:
43724372 """
43734373 with stash ['app' ].app_context ():
4374- user_fav_event = UserFavouriteEventFactory ()
4374+ user_fav_event = UserFavouriteEventFactory (event_id = 1 )
43754375 db .session .add (user_fav_event )
43764376 db .session .commit ()
43774377
@@ -4384,7 +4384,7 @@ def favourite_event_delete(transaction):
43844384 :return:
43854385 """
43864386 with stash ['app' ].app_context ():
4387- user_fav_event = UserFavouriteEventFactory ()
4387+ user_fav_event = UserFavouriteEventFactory (event_id = 1 )
43884388 db .session .add (user_fav_event )
43894389 db .session .commit ()
43904390
You can’t perform that action at this time.
0 commit comments