mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Fixed migration order
This commit is contained in:
		| @@ -1,36 +0,0 @@ | |||||||
| # Generated by Django 2.0.8 on 2018-10-07 14:20 |  | ||||||
|  |  | ||||||
| from django.db import migrations, models |  | ||||||
| from django.utils.text import slugify |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def re_slug_all_the_things(apps, schema_editor): |  | ||||||
|     """ |  | ||||||
|     Rewrite all slug values to make sure they're actually slugs before we brand |  | ||||||
|     them as uneditable. |  | ||||||
|     """ |  | ||||||
|  |  | ||||||
|     DocumentType = apps.get_model("documents", "DocumentType") |  | ||||||
|  |  | ||||||
|     for instance in DocumentType.objects.all(): |  | ||||||
|         DocumentType.objects.filter( |  | ||||||
|             pk=instance.pk |  | ||||||
|         ).update( |  | ||||||
|             slug=slugify(instance.slug) |  | ||||||
|         ) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class Migration(migrations.Migration): |  | ||||||
|  |  | ||||||
|     dependencies = [ |  | ||||||
|         ('documents', '1003_auto_20180904_1425'), |  | ||||||
|     ] |  | ||||||
|  |  | ||||||
|     operations = [ |  | ||||||
|         migrations.AlterField( |  | ||||||
|             model_name='documenttype', |  | ||||||
|             name='slug', |  | ||||||
|             field=models.SlugField(blank=True, editable=False), |  | ||||||
|         ), |  | ||||||
|         migrations.RunPython(re_slug_all_the_things, migrations.RunPython.noop) |  | ||||||
|     ] |  | ||||||
		Reference in New Issue
	
	Block a user
	 Jonas Winkler
					Jonas Winkler