Commit 4cdb6b29 by Stephan Groß

Fix authtoken migration

parent 282af605
...@@ -174,4 +174,16 @@ The name of a parameter in the URL conf that may be used to provide a format suf ...@@ -174,4 +174,16 @@ The name of a parameter in the URL conf that may be used to provide a format suf
Default: `'format'` Default: `'format'`
## REQUIRED_MIGRATIONS
This is a list of required migrations which are needed by the authtoken migration.
E.g.
(
('users', '0001_initial'),
)
Default: `'()'`
[cite]: http://www.python.org/dev/peps/pep-0020/ [cite]: http://www.python.org/dev/peps/pep-0020/
...@@ -45,6 +45,7 @@ You can determine your currently installed version using `pip freeze`: ...@@ -45,6 +45,7 @@ You can determine your currently installed version using `pip freeze`:
* Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior. Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view. * Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior. Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view.
* Bugfix for serializer data being uncacheable with pickle protocol 0. * Bugfix for serializer data being uncacheable with pickle protocol 0.
* Bugfixes for model field validation edge-cases. * Bugfixes for model field validation edge-cases.
* Bugfix for authtoken migration while using a custom user model.
### 2.2.1 ### 2.2.1
......
...@@ -4,6 +4,8 @@ from south.db import db ...@@ -4,6 +4,8 @@ from south.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models from django.db import models
from rest_framework.settings import api_settings
try: try:
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
...@@ -15,6 +17,8 @@ else: ...@@ -15,6 +17,8 @@ else:
class Migration(SchemaMigration): class Migration(SchemaMigration):
depends_on = api_settings.REQUIRED_MIGRATIONS
def forwards(self, orm): def forwards(self, orm):
# Adding model 'Token' # Adding model 'Token'
db.create_table('authtoken_token', ( db.create_table('authtoken_token', (
...@@ -45,7 +49,7 @@ class Migration(SchemaMigration): ...@@ -45,7 +49,7 @@ class Migration(SchemaMigration):
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}, },
"%s.%s" % (User._meta.app_label, User._meta.module_name): { "%s.%s" % (User._meta.app_label, User._meta.module_name): {
'Meta': {'object_name': 'User'}, 'Meta': {'object_name': User._meta.module_name},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
......
...@@ -76,6 +76,9 @@ DEFAULTS = { ...@@ -76,6 +76,9 @@ DEFAULTS = {
'URL_FORMAT_OVERRIDE': 'format', 'URL_FORMAT_OVERRIDE': 'format',
'FORMAT_SUFFIX_KWARG': 'format', 'FORMAT_SUFFIX_KWARG': 'format',
# Authtoken
'REQUIRED_MIGRATIONS': (),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment