mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 09:23:39 +01:00
28 lines
851 B
Python
28 lines
851 B
Python
|
# Generated by Django 2.0.1 on 2018-09-07 21:22
|
||
|
from django.db import migrations, models
|
||
|
import helpdesk.models
|
||
|
|
||
|
|
||
|
def clear_secret_keys(apps, schema_editor):
|
||
|
Ticket = apps.get_model("helpdesk", "Ticket")
|
||
|
db_alias = schema_editor.connection.alias
|
||
|
|
||
|
for ticket in Ticket.objects.using(db_alias).all():
|
||
|
ticket.secret_key=''
|
||
|
ticket.save()
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
('helpdesk', '0017_default_owner_on_delete_null'),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.AddField(
|
||
|
model_name='ticket',
|
||
|
name='secret_key',
|
||
|
field=models.CharField(default=helpdesk.models.mk_secret, max_length=36, null=True, verbose_name='Secret key needed for viewing/editing ticket by non-logged in users'),
|
||
|
),
|
||
|
migrations.RunPython(clear_secret_keys),
|
||
|
]
|