Skip to content

Instantly share code, notes, and snippets.

@hlmnrmr
Created September 19, 2018 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlmnrmr/5fc9d1ca0c855e7db16262d1cf96677a to your computer and use it in GitHub Desktop.
Save hlmnrmr/5fc9d1ca0c855e7db16262d1cf96677a to your computer and use it in GitHub Desktop.
'username': {
'type': 'string',
'unique': True,
'required': True,
'minlength': 1
},
'password': {
'type': 'string',
'minlength': 5
},
'password_changed_on': {
'type': 'datetime',
'nullable': True
},
'first_name': {
'type': 'string',
'readonly': self.readonly
},
'last_name': {
'type': 'string',
'readonly': self.readonly
},
'display_name': {
'type': 'string'
},
'email': {
'unique': True,
'type': 'email',
'required': True,
'coerce': lambda s: s.lower()
},
'phone': {
'type': 'string',
'nullable': True
},
'job_title': {
'type': 'string',
'required': False,
},
'biography': {
'type': 'string',
'required': False,
'nullable': True,
},
'facebook': {
'type': 'string',
'required': False,
'nullable': True,
},
'instagram': {
'type': 'string',
'required': False,
'nullable': True,
},
'twitter': {
'type': 'string',
'required': False,
'nullable': True,
'twitter': True,
},
'jid': {
'unique': True,
'type': 'string',
'required': False,
},
'language': {
'type': 'string',
'nullable': True
},
'user_info': {
'type': 'dict'
},
'picture_url': {
'type': 'string',
'nullable': True
},
'avatar': Resource.rel('upload', embeddable=True, nullable=True),
'avatar_renditions': {'type': 'dict'},
'role': Resource.rel('roles', True),
'privileges': {'type': 'dict'},
'workspace': {
'type': 'dict'
},
'user_type': {
'type': 'string',
'allowed': ['user', 'administrator'],
'default': 'user'
},
'is_support': {
'type': 'boolean',
'default': False
},
'is_author': {
'type': 'boolean',
'default': True
},
'is_active': {
'type': 'boolean',
'default': True
},
'is_enabled': {
'type': 'boolean',
'default': True
},
'needs_activation': {
'type': 'boolean',
'default': True
},
'desk': Resource.rel('desks'), # Default desk of the user, which would be selected when logged-in.
SIGN_OFF: { # Used for putting a sign-off on the content when it's created/updated except kill
'type': 'string',
'required': False,
'nullable': True,
'regex': '^[a-zA-Z0-9]+$'
},
BYLINE: {
'type': 'string',
'required': False,
'nullable': True
},
# list to hold invisible stages.
# This field is updated under following scenario:
# 1. stage visible flag is updated
# 2. desk membership is modified
# 3. new user is created
'invisible_stages': {
'type': 'list',
'required': False,
'nullable': True
},
# If Slack notifications are configured and enabled for the user
# the Slack username is stored here.
'slack_username': {
'type': 'string',
'required': False,
'nullable': True
},
# The Slack user id is stored here, to avoid repeatedly having to look it up
'slack_user_id': {
'type': 'string',
'required': False,
'nullable': True
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment