##// END OF EJS Templates
login: Make register views more robust if some POST parameters are missing....
login: Make register views more robust if some POST parameters are missing. We fail to delete passsword/password confirm parameters if they are not part of the POST parameters. But failing to delete them if they are not present seems wrong. Better silently ignore if they are not present.

File last commit:

r1:854a839a default
r1065:64aae6b3 default
Show More
049_version_4_0_0.py
49 lines | 1.5 KiB | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
import logging
import sqlalchemy as sa
from alembic.migration import MigrationContext
from alembic.operations import Operations
from rhodecode.lib.dbmigrate.versions import _reset_base
from rhodecode.model import init_model_encryption
log = logging.getLogger(__name__)
def upgrade(migrate_engine):
"""
Upgrade operations go here.
Don't create your own engine; bind migrate_engine to your metadata
"""
_reset_base(migrate_engine)
from rhodecode.lib.dbmigrate.schema import db_3_7_0_0
init_model_encryption(db_3_7_0_0)
context = MigrationContext.configure(migrate_engine.connect())
op = Operations(context)
op.create_table(
'external_identities',
sa.Column('provider_name', sa.Unicode(255), primary_key=True),
sa.Column('local_user_id', sa.Integer(),
sa.ForeignKey('users.user_id'), primary_key=True),
sa.Column('external_id', sa.Unicode(255), primary_key=True),
sa.Column('external_username', sa.Unicode(1024), default=u''),
sa.Column('access_token', sa.String(1024), default=u''),
sa.Column('alt_token', sa.String(1024), default=u''),
sa.Column('token_secret', sa.String(1024), default=u'')
)
op.create_index('local_user_id_idx', 'external_identities',
['local_user_id'])
op.create_index('external_id_idx', 'external_identities',
['external_id'])
def downgrade(migrate_engine):
pass