@@ -754,7 +754,6 @@ def update_item_permissions(refcode: str):
754754
755755
756756@ITEMS .route ("/items/<refcode>/issue-access-token" , methods = ["POST" ])
757- @active_users_or_get_only
758757def issue_physical_token (refcode : str ):
759758 """Issue a token that will give semi-permanent access to an
760759 item with this refcode. This should be used when generating
@@ -872,14 +871,9 @@ def get_item_data(item_id: str | None = None, refcode: str | None = None):
872871 redirect_url += f"?at={ access_token } "
873872 return redirect (redirect_url , code = 307 )
874873
875- valid_access_token : bool = False
874+ valid_access_token = False
876875 if refcode and access_token :
877876 valid_access_token = check_access_token (refcode , access_token )
878- if not valid_access_token :
879- return (
880- jsonify ({"status" : "error" , "message" : "Invalid access token" }),
881- 401 ,
882- )
883877
884878 if item_id :
885879 match = {"item_id" : item_id }
@@ -932,24 +926,6 @@ def get_item_data(item_id: str | None = None, refcode: str | None = None):
932926 404 ,
933927 )
934928
935- if valid_access_token :
936- pass
937-
938- elif (
939- not current_user .is_authenticated
940- and not CONFIG .TESTING
941- and doc ["type" ] != "starting_materials"
942- ):
943- return (
944- jsonify (
945- {
946- "status" : "error" ,
947- "message" : "Authentication required or invalid access token." ,
948- }
949- ),
950- 401 ,
951- )
952-
953929 # determine the item type and validate according to the appropriate schema
954930 try :
955931 ItemModel = ITEM_MODELS [doc ["type" ]]
0 commit comments