CMULTI is a thing, and therefore a max prefix length of 5 cannot be a thing

This commit is contained in:
Matthew Smith
2019-12-05 20:43:47 +00:00
parent 294c839bc3
commit 171d5d633e
2 changed files with 21 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ class Asset(models.Model):
)
parent = models.ForeignKey(to='self', related_name='asset_parent', blank=True, null=True, on_delete=models.SET_NULL)
asset_id = models.CharField(max_length=10, unique=True)
asset_id = models.CharField(max_length=15, unique=True)
description = models.CharField(max_length=120)
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
@@ -88,7 +88,7 @@ class Asset(models.Model):
# Hidden asset_id components
# For example, if asset_id was "C1001" then asset_id_prefix would be "C" and number "1001"
asset_id_prefix = models.CharField(max_length=5, default="")
asset_id_prefix = models.CharField(max_length=8, default="")
asset_id_number = models.IntegerField(default=1)
def get_available_asset_id(wanted_prefix=""):