Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
50585d05
Commit
50585d05
authored
Nov 18, 2018
by
lain
Browse files
Add User.Info module
To validate and mutate the user.info field.
parent
51435014
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user/info.ex
0 → 100644
View file @
50585d05
defmodule
Pleroma
.
User
.
Info
do
use
Ecto
.
Schema
import
Ecto
.
Changeset
embedded_schema
do
field
:banner
,
:map
,
default:
%{}
field
:source_data
,
:map
,
default:
%{}
field
:note_count
,
:integer
,
default:
0
field
:follower_count
,
:integer
,
default:
0
field
:locked
,
:boolean
,
default:
false
field
:default_scope
,
:string
,
default:
"public"
field
:blocks
,
{
:array
,
:string
},
default:
[]
field
:domain_blocks
,
{
:array
,
:string
},
default:
[]
field
:deactivated
,
:boolean
,
default:
false
field
:no_rich_text
,
:boolean
,
default:
false
field
:ap_enabled
,
:boolean
,
default:
false
field
:keys
,
:map
,
default:
%{}
end
def
set_activation_status
(
info
,
deactivated
)
do
params
=
%{
deactivated:
deactivated
}
info
|>
cast
(
params
,
[
:deactivated
])
|>
validate_required
([
:deactivated
])
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment