def save(self): "Form processor" try: ModuleSetting.set_for_module('default_perspective', self.cleaned_data['default_perspective'].id, 'maker.core') ModuleSetting.set_for_module('default_permissions', self.cleaned_data['default_permissions'], 'maker.core') ModuleSetting.set_for_module('default_timezone', self.cleaned_data['default_timezone'], 'maker.core') ModuleSetting.set_for_module('language', self.cleaned_data['language'], 'maker.core') if getattr(settings, 'MAKER_SUBSCRIPTION_CUSTOMIZATION', True): if isinstance(self.fields['logo'], forms.FileField): logopath = self._handle_uploaded_file('logo') ModuleSetting.set_for_module('logopath', logopath, 'maker.core') elif isinstance(self.fields['logo'], forms.ChoiceField): if self.cleaned_data['logo'] == 'delete': try: ModuleSetting.get_for_module('maker.core', 'logopath').delete() except: pass return True except: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_item_status', self.cleaned_data['default_item_status'].id, 'maker.infrastructure') except Exception: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_task_status', self.cleaned_data['default_task_status'].id, 'maker.projects') except Exception: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_contact_type', self.cleaned_data['default_contact_type'].id, 'maker.identities') except Exception: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_changeset_status', self.cleaned_data['default_changeset_status'].id, 'maker.changes') return True except Exception: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_perspective', self.cleaned_data['default_perspective'].id, 'maker.core', user=self.user) ModuleSetting.set_for_module('default_timezone', self.cleaned_data['default_timezone'], 'maker.core', user=self.user) ModuleSetting.set_for_module('language', self.cleaned_data['language'], 'maker.core', user=self.user) #notification settings 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, 'maker.core', user=self.user) return True except Exception as exc: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('my_company', self.cleaned_data['my_company'].id, 'maker.finance') ModuleSetting.set_for_module('default_account', self.cleaned_data['default_account'].id, 'maker.finance') currency = Currency.objects.get(pk=self.cleaned_data['default_currency']) currency.is_default = True currency.save() return True except Exception: return False
def save(self): "Form processor" fields = self.fields try: for field in fields: if self.cleaned_data[field]: if field == 'default_currency': ModuleSetting.set_for_module('default_currency', self.cleaned_data['default_currency'], 'maker.sales') currency = Currency.objects.get(pk=self.cleaned_data['default_currency']) currency.is_default = True currency.save() else: ModuleSetting.set_for_module(field, self.cleaned_data[field].id, 'maker.sales') return True except: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_ticket_status', self.cleaned_data['default_ticket_status'].id, 'maker.services') ModuleSetting.set_for_module('default_ticket_queue', self.cleaned_data['default_ticket_queue'].id, 'maker.services') ModuleSetting.set_for_module('send_email_to_caller', self.cleaned_data['send_email_to_caller'], 'maker.services') ModuleSetting.set_for_module('send_email_template', self.cleaned_data['send_email_template'], 'maker.services') return True except Exception: return False
def save(self): "Form processor" try: ModuleSetting.set_for_module('default_contact_type', self.cleaned_data['default_contact_type'].id, 'maker.messaging') except: pass try: ModuleSetting.set_for_module('default_imap_folder', self.cleaned_data['default_imap_folder'], 'maker.messaging') except: pass try: ModuleSetting.set_for_module('signature', self.cleaned_data['signature'], 'maker.messaging', user=self.user) except: pass