'Form processor'

def save(self):

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