@@ -754,7 +754,6 @@ def update_item_permissions(refcode: str):
754
754
755
755
756
756
@ITEMS .route ("/items/<refcode>/issue-access-token" , methods = ["POST" ])
757
- @active_users_or_get_only
758
757
def issue_physical_token (refcode : str ):
759
758
"""Issue a token that will give semi-permanent access to an
760
759
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):
872
871
redirect_url += f"?at={ access_token } "
873
872
return redirect (redirect_url , code = 307 )
874
873
875
- valid_access_token : bool = False
874
+ valid_access_token = False
876
875
if refcode and access_token :
877
876
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
- )
883
877
884
878
if item_id :
885
879
match = {"item_id" : item_id }
@@ -932,24 +926,6 @@ def get_item_data(item_id: str | None = None, refcode: str | None = None):
932
926
404 ,
933
927
)
934
928
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
-
953
929
# determine the item type and validate according to the appropriate schema
954
930
try :
955
931
ItemModel = ITEM_MODELS [doc ["type" ]]
0 commit comments