mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 14:45:42 +00:00 
			
		
		
		
	Allow tag fields to be empty (#4816)
Without this change, editing items (e.g. via the admin interface) fails if the tag field is not empty
This commit is contained in:
		
							
								
								
									
										20
									
								
								InvenTree/part/migrations/0107_alter_part_tags.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								InvenTree/part/migrations/0107_alter_part_tags.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
# Generated by Django 3.2.19 on 2023-05-15 00:04
 | 
			
		||||
 | 
			
		||||
from django.db import migrations
 | 
			
		||||
import taggit.managers
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('taggit', '0005_auto_20220424_2025'),
 | 
			
		||||
        ('part', '0106_part_tags'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='part',
 | 
			
		||||
            name='tags',
 | 
			
		||||
            field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
@@ -380,7 +380,8 @@ class Part(InvenTreeBarcodeMixin, InvenTreeNotesMixin, MetadataMixin, MPTTModel)
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    objects = PartManager()
 | 
			
		||||
    tags = TaggableManager()
 | 
			
		||||
 | 
			
		||||
    tags = TaggableManager(blank=True)
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        """Metaclass defines extra model properties"""
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user