2018-09-08 20:36:35 +02:00
# Generated by Django 2.0.1 on 2018-09-07 21:22
from django . db import migrations , models
import helpdesk . models
2020-10-12 09:19:46 +02:00
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 ( )
2018-09-08 20:36:35 +02:00
class Migration ( migrations . Migration ) :
dependencies = [
2020-10-12 09:19:46 +02:00
( ' helpdesk ' , ' 0018_fix_migrations ' ) ,
2018-09-08 20:36:35 +02:00
]
operations = [
2020-10-12 09:19:46 +02:00
migrations . AddField (
2018-09-08 20:36:35 +02:00
model_name = ' ticket ' ,
name = ' secret_key ' ,
field = models . CharField ( default = helpdesk . models . mk_secret , max_length = 36 , verbose_name = ' Secret key needed for viewing/editing ticket by non-logged in users ' ) ,
) ,
2020-10-12 09:19:46 +02:00
migrations . RunPython ( clear_secret_keys ) ,
2018-09-08 20:36:35 +02:00
]