#NEWLINE# @ staticmethod #NEWLINE# def update_user_links( form , user ) : #NEWLINE# #INDENT# for item in [ 'facebook' , 'twitter' , 'github' , 'globe' ] : #NEWLINE# #INDENT# data = form . get ( item ) #NEWLINE# try : #NEWLINE# #INDENT# if data : #NEWLINE# #INDENT# ( user . links . update ( { #NEWLINE# #INDENT# 'link' : data , #NEWLINE# #UNINDENT# } , icon = item ) or user . links . create ( icon = item , css_class = item , title = item , link = data ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user . links . delete ( icon = item ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# current_app . logger . error ( ( 'Error updating user links: %s' % e ) )