def apply(self): ZBasePrefsSession.apply(self) # If the user is turning off the override media storage override, then # we need to remove all of the relevant prefs so that the inheritance # from the account prefs works properly. if KEY_OVERRIDE_MEDIA_STORE in self.newSettings: self.userPrefs.setUserPreference( IZBlogAppUserPrefsKeys.BLOG_OVERRIDE_MEDIA_STORE, self.newSettings[KEY_OVERRIDE_MEDIA_STORE]) if not self.newSettings[KEY_OVERRIDE_MEDIA_STORE]: self.blog.setMediaUploadStorageId(None) # If the user is turning off the override template override, then we need # to remove all of the relevant prefs so that the inheritance from the # account prefs works properly. if KEY_OVERRIDE_TEMPLATE in self.newSettings: self.userPrefs.setUserPreference( IZBlogAppUserPrefsKeys.BLOG_OVERRIDE_TEMPLATE, self.newSettings[KEY_OVERRIDE_TEMPLATE]) if not self.newSettings[KEY_OVERRIDE_TEMPLATE]: self.blog.setTemplateId(None) self._getAccountStore().saveAccount(self.blog.getAccount()) self.newSettings = {}
def apply(self): ZBasePrefsSession.apply(self) if KEY_ACCOUNT_USERNAME in self.newSettings: self.account.setUsername(self.newSettings[KEY_ACCOUNT_USERNAME]) if KEY_ACCOUNT_PASSWORD in self.newSettings: self.account.setPassword(self.newSettings[KEY_ACCOUNT_PASSWORD]) if KEY_ACCOUNT_API_URL in self.newSettings: apiinfo = ZAccountAPIInfo() apiinfo.setType(self.account.getAPIInfo().getType()) apiinfo.setUrl(self.newSettings[KEY_ACCOUNT_API_URL]) self.account.setAPIInfo(apiinfo) self._getAccountStore().saveAccount(self.account) self.newSettings = {}
def apply(self): ZBasePrefsSession.apply(self) # If the user is turning off the override media storage override, then # we need to remove all of the relevant prefs so that the inheritance # from the account prefs works properly. if KEY_OVERRIDE_MEDIA_STORE in self.newSettings: self.userPrefs.setUserPreference(IZBlogAppUserPrefsKeys.BLOG_OVERRIDE_MEDIA_STORE, self.newSettings[KEY_OVERRIDE_MEDIA_STORE]) if not self.newSettings[KEY_OVERRIDE_MEDIA_STORE]: self.blog.setMediaUploadStorageId(None) # If the user is turning off the override template override, then we need # to remove all of the relevant prefs so that the inheritance from the # account prefs works properly. if KEY_OVERRIDE_TEMPLATE in self.newSettings: self.userPrefs.setUserPreference(IZBlogAppUserPrefsKeys.BLOG_OVERRIDE_TEMPLATE, self.newSettings[KEY_OVERRIDE_TEMPLATE]) if not self.newSettings[KEY_OVERRIDE_TEMPLATE]: self.blog.setTemplateId(None) self._getAccountStore().saveAccount(self.blog.getAccount()) self.newSettings = {}