Fakultas Ilmu Komputer UI

Commit 8156ac42 authored by Satryaji Aulia's avatar Satryaji Aulia
Browse files

Add constraint to Company.status

parent 84c33fbd
Pipeline #25177 failed with stages
in 5 minutes and 2 seconds
...@@ -140,7 +140,7 @@ class Company(models.Model): ...@@ -140,7 +140,7 @@ class Company(models.Model):
updated = models.DateTimeField(auto_now=True) updated = models.DateTimeField(auto_now=True)
user = models.OneToOneField(User) user = models.OneToOneField(User)
description = models.TextField() description = models.TextField()
status = models.IntegerField(default=NEW) status = models.IntegerField(validators=[MaxValueValidator(2), MinValueValidator(0))
logo = models.FileField(upload_to=get_company_logo_file_path, null=True, blank=True, validators=[validate_image_file_extension]) logo = models.FileField(upload_to=get_company_logo_file_path, null=True, blank=True, validators=[validate_image_file_extension])
address = models.CharField(max_length=1000, blank=True, null=True) address = models.CharField(max_length=1000, blank=True, null=True)
category = models.CharField(max_length=140, default="Belum ada kategori perusahaan") category = models.CharField(max_length=140, default="Belum ada kategori perusahaan")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment