#NEWLINE# def save( self ) : #NEWLINE# #INDENT# 'Form processor' #NEWLINE# try : #NEWLINE# #INDENT# ModuleSetting . set_for_module ( 'default_perspective' , self . cleaned_data [ 'default_perspective' ] . id , 'treeio.core' , user = self . user ) #NEWLINE# ModuleSetting . set_for_module ( 'default_timezone' , self . cleaned_data [ 'default_timezone' ] , 'treeio.core' , user = self . user ) #NEWLINE# ModuleSetting . set_for_module ( 'language' , self . cleaned_data [ 'language' ] , 'treeio.core' , user = self . user ) #NEWLINE# email_notifications = self . cleaned_data [ 'email_notifications' ] #NEWLINE# ( notification , created ) = NotificationSetting . objects . get_or_create ( owner = self . user ) #NEWLINE# if ( email_notifications in ( 'd' , 'w' , 'm' ) ) : #NEWLINE# #INDENT# notification . ntype = email_notifications #NEWLINE# if ( not notification . enabled ) : #NEWLINE# #INDENT# notification . enabled = True #NEWLINE# notification . update_date ( date . today ( ) ) #NEWLINE# #UNINDENT# notification . save ( ) #NEWLINE# notification . modules . clear ( ) #NEWLINE# for m in Module . objects . filter ( pk__in = self . cleaned_data [ 'notifications_for_modules' ] ) : #NEWLINE# #INDENT# notification . modules . add ( email_notifications ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# notification . enabled = False #NEWLINE# notification . save ( ) #NEWLINE# #UNINDENT# ModuleSetting . set_for_module ( 'email_notifications' , email_notifications , 'treeio.core' , user = self . user ) #NEWLINE# return True #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return False