@classmethod
def ensure_edm_obj(cls, guid):
    user = User.query.filter((User.guid == guid)).first()
    is_new = (user is None)
    if is_new:
        email = ('%s@localhost' % (guid,))
        password = User.initial_random_password()
        user = User(guid=guid, email=email, password=password, version=None, is_active=True, in_alpha=True)
        with db.session.begin():
            db.session.add(user)
        db.session.refresh(user)
    return (user, is_new)
@classmethod
def ensure_edm_obj(cls, guid):
    user = User.query.filter((User.guid == guid)).first()
    is_new = (user is None)
    if is_new:
        email = ('%s@localhost' % (guid,))
        password = User.initial_random_password()
        user = User(guid=guid, email=email, password=password, version=None, is_active=True, in_alpha=True)
        with db.session.begin():
            db.session.add(user)
        db.session.refresh(user)
    return (user, is_new)