コード例 #1
0
ファイル: forms.py プロジェクト: jeremykid/reviewboard
 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()
コード例 #2
0
ファイル: forms.py プロジェクト: teotikalki/reviewboard
 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()
コード例 #3
0
    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)
コード例 #4
0
ファイル: forms.py プロジェクト: zjxbetter/reviewboard
    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)