|
a/Allura/allura/model/auth.py |
|
b/Allura/allura/model/auth.py |
|
... |
|
... |
13 |
import iso8601
|
13 |
import iso8601
|
14 |
import pymongo
|
14 |
import pymongo
|
15 |
from pylons import c, g, request
|
15 |
from pylons import c, g, request
|
16 |
|
16 |
|
17 |
from ming import schema as S
|
17 |
from ming import schema as S
|
18 |
from ming import Field, Index, collection
|
18 |
from ming import Field, collection
|
19 |
from ming.orm import session, state
|
19 |
from ming.orm import session, state
|
20 |
from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
|
20 |
from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
|
21 |
from ming.orm.declarative import MappedClass
|
21 |
from ming.orm.declarative import MappedClass
|
22 |
|
22 |
|
23 |
import allura.tasks.mail_tasks
|
23 |
import allura.tasks.mail_tasks
|
24 |
from allura.lib import helpers as h
|
24 |
from allura.lib import helpers as h
|
25 |
from allura.lib import plugin
|
25 |
from allura.lib import plugin
|
26 |
|
26 |
|
27 |
from .session import main_orm_session, main_doc_session
|
27 |
from .session import main_orm_session, main_doc_session
|
28 |
from .session import project_orm_session
|
28 |
from .session import project_orm_session
|
|
|
29 |
from .timeline import Node, ActivityObject
|
29 |
|
30 |
|
30 |
log = logging.getLogger(__name__)
|
31 |
log = logging.getLogger(__name__)
|
31 |
|
32 |
|
32 |
def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'):
|
33 |
def smart_str(s, encoding='utf-8', strings_only=False, errors='strict'):
|
33 |
"""
|
34 |
"""
|
|
... |
|
... |
268 |
g = cls.query.find_and_modify(
|
269 |
g = cls.query.find_and_modify(
|
269 |
query={}, update={'$inc':{'next_uid': 1}},
|
270 |
query={}, update={'$inc':{'next_uid': 1}},
|
270 |
new=True)
|
271 |
new=True)
|
271 |
return g.next_uid
|
272 |
return g.next_uid
|
272 |
|
273 |
|
273 |
class User(MappedClass):
|
274 |
class User(MappedClass, Node, ActivityObject):
|
274 |
SALT_LEN=8
|
275 |
SALT_LEN=8
|
275 |
class __mongometa__:
|
276 |
class __mongometa__:
|
276 |
name='user'
|
277 |
name='user'
|
277 |
session = main_orm_session
|
278 |
session = main_orm_session
|
278 |
indexes = [ 'tool_data.sfx.userid' ]
|
279 |
indexes = [ 'tool_data.sfx.userid' ]
|