/* global OC */

/**
 * Copyright (c) 2016, Christoph Wurst <christoph@owncloud.com>
 *
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */

(function() {
	'use strict';

	/**
	 * Model for storing and saving user settings
	 *
	 * @class UserSettings
	 */
	var UserSettings = OC.Backbone.Model.extend({
		url: OC.generateUrl('/settings/users/{id}/settings', {id: OC.currentUser}),
		isNew: function() {
			return false; // Force PUT on .save()
		},
		parse: function(data) {
			if (_.isUndefined(data)) {
				return null;
			}

			if (data.status && data.status === 'error') {
				OC.Notification.show(data.data.message, { type: 'error' });
			}

			if (_.isUndefined(data.data)) {
				return null;
			}
			data = data.data;

			var ignored = [
				'userId',
				'message'
			];

			_.each(ignored, function(ign) {
				if (!_.isUndefined(data[ign])) {
					delete data[ign];
				}
			});

			return data;
		}
	});

	OC.Settings = OC.Settings || {};

	OC.Settings.UserSettings = UserSettings;
})();

@@ -233,16 +233,41 @@
 rict';%0A%0A
+%09var errorNotification;%0A%0A
 %09/**%0A%09 *
@@ -611,24 +611,88 @@
 null;%0A%09%09%09%7D%0A%0A
+%09%09%09if (errorNotification) %7B%0A%09%09%09%09errorNotification.hide();%0A%09%09%09%7D%0A%0A
 %09%09%09if (data.
@@ -732,16 +732,36 @@
 ) %7B%0A%09%09%09%09
+errorNotification = 
 OC.Notif

Remove notifications when retesting