@@ -36,12 +36,25 @@ def get_project_metadata_bare(project_name, include_complete_image_count=False):
3636 if len (results ) > 1 :
3737 raise SAExistingProjectNameException (
3838 0 , "Project name " + project_name +
39- " is not unique. To use SDK please make project names unique."
39+ " is not unique. To use SDK please make project names unique."
4040 )
4141 elif len (results ) == 1 :
4242 res = results [0 ]
4343 res ["type" ] = common .project_type_int_to_str (res ["type" ])
4444 res ["user_role" ] = common .user_role_int_to_str (res ["user_role" ])
45+ current_frame = inspect .currentframe ()
46+ outer_function = inspect .getframeinfo (current_frame .f_back ).function
47+ outer_outer_function = inspect .getframeinfo (
48+ current_frame .f_back .f_back
49+ ).function
50+ if res .get ("type" ) and res ["type" ] == "Video" and (
51+ outer_function in common .VIDEO_DEPRICATED_FUNCTIONS or
52+ outer_outer_function in common .VIDEO_DEPRICATED_FUNCTIONS
53+ ):
54+ raise SABaseException (
55+ 0 ,
56+ "The function does not support projects containing videos attached with URLs"
57+ )
4558 return res
4659 else :
4760 raise SANonExistingProjectNameException (
@@ -134,11 +147,16 @@ def get_project_and_folder_metadata(project):
134147 raise SAIncorrectProjectArgument (project )
135148 current_frame = inspect .currentframe ()
136149 outer_function = inspect .getframeinfo (current_frame .f_back ).function
137- outer_outer_function = inspect .getframeinfo (current_frame .f_back .f_back ).function
138- if project ["type" ] == "Video" \
150+ outer_outer_function = inspect .getframeinfo (
151+ current_frame .f_back .f_back
152+ ).function
153+ if project .get ("type" ) and project ["type" ] == "Video" \
139154 and (outer_function in common .VIDEO_DEPRICATED_FUNCTIONS
140155 or outer_outer_function in common .VIDEO_DEPRICATED_FUNCTIONS ):
141- raise SABaseException (0 , "The function does not support projects containing videos attached with URLs" )
156+ raise SABaseException (
157+ 0 ,
158+ "The function does not support projects containing videos attached with URLs"
159+ )
142160 return project , folder
143161
144162
@@ -210,9 +228,9 @@ def create_folder(project, folder_name):
210228 params = {"team_id" : project ["team_id" ], "project_id" : project ["id" ]}
211229 name_changed = False
212230 if len (
213- set (folder_name ).intersection (
214- common .SPECIAL_CHARACTERS_IN_PROJECT_FOLDER_NAMES
215- )
231+ set (folder_name ).intersection (
232+ common .SPECIAL_CHARACTERS_IN_PROJECT_FOLDER_NAMES
233+ )
216234 ) > 0 :
217235 logger .warning (
218236 "New folder name has special characters. Special characters will be replaced by underscores."
0 commit comments