#NEWLINE# @ log_helpers . log_method_call #NEWLINE# def update_tag( self , context , resource , resource_id , tag ) : #NEWLINE# #INDENT# res = self . _get_resource ( context , resource , resource_id ) #NEWLINE# if any ( ( ( tag == tag_db . tag ) for tag_db in res . standard_attr . tags ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# tag_db = tag_model . Tag ( standard_attr_id = res . standard_attr_id , tag = tag ) #NEWLINE# context . session . add ( tag_db ) #NEWLINE# #UNINDENT# #UNINDENT# except db_exc . DBDuplicateEntry : #NEWLINE# #INDENT# pass