status txt
This commit is contained in:
@@ -67,6 +67,19 @@ class ProductsService(BaseService):
|
||||
logger.info(f"Product Data ****** *****: {products}")
|
||||
|
||||
for t in products:
|
||||
|
||||
st_text = "Activate Now"
|
||||
# match str(t.status):
|
||||
if t.status == 1:
|
||||
st_text = "Coming Soon"
|
||||
|
||||
if t.status == 5:
|
||||
st_text = "Activate Now"
|
||||
|
||||
if t.status == 6:
|
||||
st_text = "Creating"
|
||||
|
||||
|
||||
product_data.append({
|
||||
'id': t.id,
|
||||
'uid': t.uid,
|
||||
@@ -79,7 +92,7 @@ class ProductsService(BaseService):
|
||||
'updated': t.updated.isoformat() if t.updated else None,
|
||||
'banner': t.banner,
|
||||
'prov_status': 5,
|
||||
'status_text': ProductsService._status_text(t.status)
|
||||
'status_text': st_text
|
||||
})
|
||||
|
||||
# export
|
||||
@@ -116,20 +129,20 @@ class ProductsService(BaseService):
|
||||
db.session.rollback()
|
||||
return ResponseHelper.internal_server_error()
|
||||
|
||||
@staticmethod
|
||||
def _status_text(status):
|
||||
st_text = "Activate Now"
|
||||
match status:
|
||||
case 1:
|
||||
st_text = "Coming Soon"
|
||||
case 5:
|
||||
st_text = "Activate Now"
|
||||
case 6:
|
||||
st_text = "Creating"
|
||||
case _:
|
||||
st_text = "Activate Now"
|
||||
|
||||
return st_text
|
||||
# @staticmethod
|
||||
# def _status_text(self, status):
|
||||
# st_text = "Activate Now"
|
||||
# match str(status):
|
||||
# case "1":
|
||||
# st_text = "Coming Soon"
|
||||
# case "5":
|
||||
# st_text = "Activate Now"
|
||||
# case "6":
|
||||
# st_text = "Creating"
|
||||
# case _:
|
||||
# st_text = "Activate Now"
|
||||
#
|
||||
# return st_text
|
||||
|
||||
@staticmethod
|
||||
def product_url_request(data):
|
||||
|
||||
Reference in New Issue
Block a user