def save(self): """Save the enabled services and default service to the database.""" avatar_services.enabled_services = [ avatar_services.get('id', service_id) for service_id in self.cleaned_data['enabled_services'] ] avatar_services.default_service = self.cleaned_data['default_service'] avatar_services.avatars_enabled = self.cleaned_data['avatars_enabled'] avatar_services.save()
def save(self): """Save the enabled services and default service to the database.""" avatar_services.enabled_services = [ avatar_services.get('avatar_service_id', service_id) for service_id in self.cleaned_data['enabled_services'] ] avatar_services.set_default_service( self.cleaned_data['default_service'], save=False) avatar_services.avatars_enabled = self.cleaned_data['avatars_enabled'] avatar_services.save()
def save(self): """Save the enabled services and default service to the database.""" avatar_services.enabled_services = [ avatar_services.get('avatar_service_id', service_id) for service_id in self.cleaned_data['enabled_services'] ] avatar_services.set_default_service( self.cleaned_data['default_service'], save=False) avatars_enabled_changed = (avatar_services.avatars_enabled != self.cleaned_data['avatars_enabled']) avatar_services.avatars_enabled = self.cleaned_data['avatars_enabled'] avatar_services.save() if avatars_enabled_changed: if avatar_services.avatars_enabled: AccountPage.registry.add_form_to_page(ProfilePage, AvatarSettingsForm) else: AccountPage.registry.remove_form_from_page( ProfilePage, AvatarSettingsForm)
def save(self): """Save the enabled services and default service to the database.""" avatar_services.enabled_services = [ avatar_services.get('avatar_service_id', service_id) for service_id in self.cleaned_data['enabled_services'] ] avatar_services.set_default_service( self.cleaned_data['default_service'], save=False) avatars_enabled_changed = (avatar_services.avatars_enabled != self.cleaned_data['avatars_enabled']) avatar_services.avatars_enabled = self.cleaned_data['avatars_enabled'] avatar_services.save() if avatars_enabled_changed: if avatar_services.avatars_enabled: AccountPage.registry.add_form_to_page(ProfilePage, AvatarSettingsForm) else: AccountPage.registry.remove_form_from_page(ProfilePage, AvatarSettingsForm)