add leading zeros to project PID

This commit is contained in:
Benni Baermann 2021-02-02 14:42:34 +01:00
parent 079c1c3933
commit fd00d1b67a

View file

@ -77,7 +77,7 @@ class Project(Volunteer):
def save(self,*args,**kwargs): def save(self,*args,**kwargs):
# is there a way to call super().save() only once? # is there a way to call super().save() only once?
super().save(*args,*kwargs) super().save(*args,*kwargs)
self.pid = self.account + str(self.pk) self.pid = self.account + str(self.pk).zfill(3)
super().save(*args,*kwargs) super().save(*args,*kwargs)
def __str__(self): def __str__(self):