feat: rename boring avatar to marble (because that's what it is)
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2021-12-07 21:34:34 +01:00
parent eb1254a230
commit a10d162f5e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
7 changed files with 10 additions and 9 deletions

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package boring
package marble
import (
"math"

View File

@ -22,10 +22,10 @@ import (
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/avatar"
"code.vikunja.io/api/pkg/modules/avatar/boring"
"code.vikunja.io/api/pkg/modules/avatar/empty"
"code.vikunja.io/api/pkg/modules/avatar/gravatar"
"code.vikunja.io/api/pkg/modules/avatar/initials"
"code.vikunja.io/api/pkg/modules/avatar/marble"
"code.vikunja.io/api/pkg/modules/avatar/upload"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web/handler"
@ -78,8 +78,8 @@ func GetAvatar(c echo.Context) error {
avatarProvider = &initials.Provider{}
case "upload":
avatarProvider = &upload.Provider{}
case "boring":
avatarProvider = &boring.Provider{}
case "marble":
avatarProvider = &marble.Provider{}
default:
avatarProvider = &empty.Provider{}
}

View File

@ -29,7 +29,7 @@ import (
// UserAvatarProvider holds the user avatar provider type
type UserAvatarProvider struct {
// The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `boring` (generates a random avatar for each user), `default`.
// The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `marble` (generates a random avatar for each user), `default`.
AvatarProvider string `json:"avatar_provider"`
}

View File

@ -8915,7 +8915,7 @@ var doc = `{
"type": "object",
"properties": {
"avatar_provider": {
"description": "The avatar provider. Valid types are ` + "`" + `gravatar` + "`" + ` (uses the user email), ` + "`" + `upload` + "`" + `, ` + "`" + `initials` + "`" + `, ` + "`" + `boring` + "`" + ` (generates a random avatar for each user), ` + "`" + `default` + "`" + `.",
"description": "The avatar provider. Valid types are ` + "`" + `gravatar` + "`" + ` (uses the user email), ` + "`" + `upload` + "`" + `, ` + "`" + `initials` + "`" + `, ` + "`" + `marble` + "`" + ` (generates a random avatar for each user), ` + "`" + `default` + "`" + `.",
"type": "string"
}
}

View File

@ -8899,7 +8899,7 @@
"type": "object",
"properties": {
"avatar_provider": {
"description": "The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `boring` (generates a random avatar for each user), `default`.",
"description": "The avatar provider. Valid types are `gravatar` (uses the user email), `upload`, `initials`, `marble` (generates a random avatar for each user), `default`.",
"type": "string"
}
}

View File

@ -1235,7 +1235,7 @@ definitions:
properties:
avatar_provider:
description: The avatar provider. Valid types are `gravatar` (uses the user
email), `upload`, `initials`, `boring` (generates a random avatar for each
email), `upload`, `initials`, `marble` (generates a random avatar for each
user), `default`.
type: string
type: object

View File

@ -455,7 +455,8 @@ func UpdateUser(s *xorm.Session, user *User) (updatedUser *User, err error) {
if user.AvatarProvider != "default" &&
user.AvatarProvider != "gravatar" &&
user.AvatarProvider != "initials" &&
user.AvatarProvider != "upload" {
user.AvatarProvider != "upload" &&
user.AvatarProvider != "marble" {
return updatedUser, &ErrInvalidAvatarProvider{AvatarProvider: user.AvatarProvider}
}
}