photoprism/internal/form/user.go
Michael Mayer 2186b923c9 Merge remote-tracking branch 'origin/develop' into feature/oidc-v2
# Conflicts:
#	docker-compose.mariadb.yml
#	docker-compose.yml
#	frontend/src/component/navigation.vue
#	frontend/src/pages/albums.vue
#	frontend/tests/acceptance/settings/general.js
#	go.mod
#	go.sum
#	internal/commands/users.go
#	internal/config/flags.go
#	internal/config/options.go
#	internal/entity/user.go
#	scripts/build.sh
#	scripts/docker/arch.sh
#	scripts/sql/init-test-databases.sql
2021-12-18 11:57:44 +01:00

17 lines
489 B
Go

package form
import "github.com/photoprism/photoprism/pkg/sanitize"
// UserCreate represents a User with a new password.
type UserCreate struct {
UserName string `json:"username"`
FullName string `json:"fullname"`
Email string `json:"email"`
Password string `json:"password"`
Admin bool `json:"admin"`
}
// Username returns the normalized username in lowercase and without whitespace padding.
func (f UserCreate) Username() string {
return sanitize.Username(f.UserName)
}