Commits

Kyle Valade committed d32d2e9

0002_auto__add_field_consumer_xauth_allowed.py edited online with Bitbucket - set Consumer and Token's secret to use the value set by the application instead of 16

Comments (0)

Files changed (1)

oauth_provider/migrations/0002_auto__add_field_consumer_xauth_allowed.py

 from south.db import db
 from south.v2 import SchemaMigration
 from django.db import models
+from oauth_provider.consts import SECRET_SIZE
 
 class Migration(SchemaMigration):
 
     def forwards(self, orm):
-        
+
         # Adding field 'Consumer.xauth_allowed'
         db.add_column('oauth_provider_consumer', 'xauth_allowed', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
 
 
     def backwards(self, orm):
-        
+
         # Deleting field 'Consumer.xauth_allowed'
         db.delete_column('oauth_provider_consumer', 'xauth_allowed')
 
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'key': ('django.db.models.fields.CharField', [], {'max_length': '256'}),
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
-            'secret': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}),
+            'secret': ('django.db.models.fields.CharField', [], {'max_length': str(SECRET_SIZE), 'blank': 'True'}),
             'status': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
             'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
             'xauth_allowed': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
             'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
             'key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
             'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['oauth_provider.Resource']"}),
-            'secret': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),
+            'secret': ('django.db.models.fields.CharField', [], {'max_length': str(SECRET_SIZE), 'null': 'True', 'blank': 'True'}),
             'timestamp': ('django.db.models.fields.IntegerField', [], {'default': '1327884847L'}),
             'token_type': ('django.db.models.fields.SmallIntegerField', [], {}),
             'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tokens'", 'null': 'True', 'to': "orm['auth.User']"}),