Fakultas Ilmu Komputer UI

Commit d8455b96 authored by Ryan Karyadiputera's avatar Ryan Karyadiputera
Browse files

test3

parent 216a8c96
Pipeline #81605 passed with stage
in 2 minutes and 56 seconds
......@@ -122,21 +122,21 @@ class LaporanAkhirPraktikum(AttributeLaporanPraktikum):
profil_lembaga = models.FileField(blank=True, null=True)
umpan_balik = models.CharField(max_length=255, blank=True, default=" ")
# def getLembagaID(self):
# return self.lembaga.id
def getLembagaID(self):
return self.lembaga.id
# def updateTahun(self):
# currentYear = self.lembaga.last_activity
# newYear = self.periode_praktikum[:4]
# if newYear != '' and (currentYear == None or currentYear < int(newYear)):
# return newYear
def updateTahun(self):
currentYear = self.lembaga.last_insertion
newYear = self.periode_praktikum[:4]
if newYear != '' and (currentYear == None or currentYear < int(newYear)):
return newYear
# else:
# return currentYear
else:
return currentYear
# def save(self, *args, **kwargs):
# Lembaga.objects.filter(id = self.getLembagaID()).update(last_activity = self.updateTahun())
# super().save(*args,**kwargs)
def save(self, *args, **kwargs):
Lembaga.objects.filter(id = self.getLembagaID()).update(last_insertion = self.updateTahun())
super().save(*args,**kwargs)
def __str__(self): # pragma: no cover
return self.nama_laporan
......
Markdown is supported
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