mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
Update captcha
This commit is contained in:
@@ -1,39 +1,26 @@
|
||||
# encoding: utf-8
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import SchemaMigration
|
||||
from django.db import models
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
# Adding model 'CaptchaStore'
|
||||
db.create_table('captcha_captchastore', (
|
||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
('challenge', self.gf('django.db.models.fields.CharField')(max_length=32)),
|
||||
('response', self.gf('django.db.models.fields.CharField')(max_length=32)),
|
||||
('hashkey', self.gf('django.db.models.fields.CharField')(unique=True, max_length=40)),
|
||||
('expiration', self.gf('django.db.models.fields.DateTimeField')()),
|
||||
))
|
||||
db.send_create_signal('captcha', ['CaptchaStore'])
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
# Deleting model 'CaptchaStore'
|
||||
db.delete_table('captcha_captchastore')
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
models = {
|
||||
'captcha.captchastore': {
|
||||
'Meta': {'object_name': 'CaptchaStore'},
|
||||
'challenge': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
|
||||
'expiration': ('django.db.models.fields.DateTimeField', [], {}),
|
||||
'hashkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}),
|
||||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
|
||||
'response': ('django.db.models.fields.CharField', [], {'max_length': '32'})
|
||||
}
|
||||
}
|
||||
|
||||
complete_apps = ['captcha']
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CaptchaStore',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('challenge', models.CharField(max_length=32)),
|
||||
('response', models.CharField(max_length=32)),
|
||||
('hashkey', models.CharField(unique=True, max_length=40)),
|
||||
('expiration', models.DateTimeField()),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
||||
|
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Django migrations for django-simple-captcha app
|
||||
|
||||
This package does not contain South migrations. South migrations can be found
|
||||
in the ``south_migrations`` package.
|
||||
"""
|
||||
|
||||
SOUTH_ERROR_MESSAGE = """\n
|
||||
For South support, customize the SOUTH_MIGRATION_MODULES setting like so:
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'captcha': 'captcha.south_migrations',
|
||||
}
|
||||
"""
|
||||
|
||||
# Ensure the user is not using Django 1.6 or below with South
|
||||
try:
|
||||
from django.db import migrations # noqa
|
||||
except ImportError:
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
raise ImproperlyConfigured(SOUTH_ERROR_MESSAGE)
|
Reference in New Issue
Block a user