def make_permalink(img_id):
profile, filename = img_id.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>new_img_id = profile + '<STR_LIT::>' + remove_tmp_prefix_from_filename(filename)<EOL>urls = get_files_by_img_id(img_id)<EOL>if urls is None:<EOL><INDENT>return urls<EOL><DEDENT>move_list = {(urls['<STR_LIT>'], remove_tmp_prefix_from_file_path(urls['<STR_LIT>']))}<EOL>for var_label, var_file_path in urls['<STR_LIT>'].iteritems():<EOL><INDENT>move_list.add((var_file_path, remove_tmp_prefix_from_file_path(var_file_path)))<EOL><DEDENT>for file_path_from, file_path_to in move_list:<EOL><INDENT>os.rename(media_path(file_path_from), media_path(file_path_to))<EOL><DEDENT>return new_img_id<EOL>
Removes tmp prefix from filename and rename main and variant files.
Returns img_id without tmp prefix.