Fakultas Ilmu Komputer UI

Commit 72851ff9 authored by Muhammad Azhar Hassanuddin's avatar Muhammad Azhar Hassanuddin
Browse files

feat: saat update toko tidak increment nomor toko terhadap diri sendiri

parent c55ec848
......@@ -54,6 +54,7 @@ class Toko(models.Model):
def save(self, *args, **kwargs):
toko_with_same_name = Toko.objects.filter(nama_toko = self.nama_toko)\
.exclude(id = self.id)\
.order_by('-nomor_toko')
try:
last_added_toko = toko_with_same_name[0]
......
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