mirror of https://github.com/interlegis/sapl.git
2 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-27 17:40 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
from django.conf import settings |
|||
from django.contrib.auth.models import User |
|||
from rest_framework.authtoken.models import Token |
|||
|
|||
|
|||
def adiciona_token_nos_usuarios(apps, schema_editor): |
|||
for user in User.objects.all(): |
|||
Token.objects.get_or_create(user=user) |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
initial = True |
|||
|
|||
dependencies = [ |
|||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(adiciona_token_nos_usuarios) |
|||
] |
|||
Loading…
Reference in new issue