Commit c5b86181 authored by Robert's avatar Robert

Make secret_key unique

parent 415286eb
# Generated by Django 2.0.5 on 2018-06-07 09:28
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='permissiontoken',
name='secret_key',
field=models.CharField(default=core.models.generate_token, max_length=15, unique=True),
),
]
......@@ -91,8 +91,8 @@ class PermissionToken(models.Model):
authenticated user is really allowed to access the given resource.
"""
gestalt = models.ForeignKey('gestalten.Gestalt', on_delete=models.CASCADE)
# FIXME: secret_key should be unique
secret_key = models.CharField(max_length=PERMISSION_TOKEN_LENGTH, default=generate_token)
secret_key = models.CharField(
max_length=PERMISSION_TOKEN_LENGTH, default=generate_token, unique=True)
time_created = models.DateTimeField(auto_now_add=True)
# Every feature (e.g. the calendar) defines its own unique string describing its permission
# token (e.g. "calendar-read").
......
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