Skip to content

Commit

Permalink
fix: cod payment
Browse files Browse the repository at this point in the history
  • Loading branch information
yashsuhagiya committed Jan 10, 2024
1 parent 1047dd0 commit 771d822
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ class Product(models.Model):

def __str__(self):
return self.name

def save(self, *args, **kwargs):
# Convert the comma-separated string to a list
if isinstance(self.category, str):
self.category = self.category.split(',')
if isinstance(self.size, str):
self.size = self.size.split(',')

super().save(*args, **kwargs)

@property
def imageURL(self):
Expand Down

0 comments on commit 771d822

Please sign in to comment.