Fix data
This commit is contained in:
@@ -30,19 +30,19 @@ class LoginService(BaseService):
|
|||||||
member = Members.get_member_by_username(username)
|
member = Members.get_member_by_username(username)
|
||||||
if not member:
|
if not member:
|
||||||
invalid_data = {
|
invalid_data = {
|
||||||
"error_message": "invalid username or password",
|
"error_message": "You will get email to continue the process if the account is valid",
|
||||||
|
"reset_message": "",
|
||||||
"message_key": "invalid_username_or_password",
|
"message_key": "invalid_username_or_password",
|
||||||
}
|
}
|
||||||
return ResponseHelper.success(data=invalid_data)
|
return ResponseHelper.success(data=invalid_data)
|
||||||
|
|
||||||
reset_data = PasswordReset.create_reset(username=username)
|
reset_data = PasswordReset.create_reset(username=username)
|
||||||
|
|
||||||
BaseService.send_resetpass_mail(member.email, str(member.uid), member.id, "FF","LL") #pending_uid, pending_id, firstname, lastname
|
BaseService.send_resetpass_mail(member.email, str(member.uid), member.id, "FF","LL") #pending_uid, pending_id, firstname, lastname
|
||||||
|
|
||||||
|
|
||||||
response_data = {
|
response_data = {
|
||||||
"error_message": "invalid username or password 000",
|
"error_message": "",
|
||||||
"message_key": "invalid_username_or_password",
|
"reset_message": "Check your email to continue password reset.",
|
||||||
|
"message_key": "check_your_email_message",
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResponseHelper.success(data=response_data)
|
return ResponseHelper.success(data=response_data)
|
||||||
|
|||||||
@@ -188,10 +188,13 @@ class MyProductsService(BaseService):
|
|||||||
|
|
||||||
merms_panel=#
|
merms_panel=#
|
||||||
"Product Description - Commitment is something that comes from understanding that everything has its price and then having the willingness to pay that price. This is important because nobody wants to put significant effort into something, only to find out after the fact that the price was too high.The price is something not necessarily defined as financial. It could be time, effort, sacrifice, money or perhaps, something else.",
|
"Product Description - Commitment is something that comes from understanding that everything has its price and then having the willingness to pay that price. This is important because nobody wants to put significant effort into something, only to find out after the fact that the price was too high.The price is something not necessarily defined as financial. It could be time, effort, sacrifice, money or perhaps, something else.",
|
||||||
|
'internal_url': self.internal_url,
|
||||||
|
'external_url': self.external_url,
|
||||||
|
|
||||||
'''
|
'''
|
||||||
product_subscription_uid=''
|
product_subscription_uid=''
|
||||||
|
product_subscription_external_url = ''
|
||||||
|
product_subscription_internal_url = ''
|
||||||
product_data = Products.get_product_by_product_id(product_id)
|
product_data = Products.get_product_by_product_id(product_id)
|
||||||
product_description = ProductsDetails.get_product_details_with_product_id('A000002')
|
product_description = ProductsDetails.get_product_details_with_product_id('A000002')
|
||||||
productDataStatus = product_data.status
|
productDataStatus = product_data.status
|
||||||
@@ -201,6 +204,8 @@ class MyProductsService(BaseService):
|
|||||||
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
logger.info(f"Incoming MyProduct data ==>>>> {memberSubscription}")
|
||||||
productDataStatus = memberSubscription.status
|
productDataStatus = memberSubscription.status
|
||||||
product_subscription_uid = memberSubscription.uid
|
product_subscription_uid = memberSubscription.uid
|
||||||
|
product_subscription_external_url = memberSubscription.external_url
|
||||||
|
product_subscription_internal_url = memberSubscription.internal_url
|
||||||
|
|
||||||
|
|
||||||
# "banner": "banner.jpg",
|
# "banner": "banner.jpg",
|
||||||
@@ -209,7 +214,8 @@ class MyProductsService(BaseService):
|
|||||||
"banner": product_data.banner,
|
"banner": product_data.banner,
|
||||||
"description": product_description.details,
|
"description": product_description.details,
|
||||||
"sale_text" : product_description.sale_text,
|
"sale_text" : product_description.sale_text,
|
||||||
"internal_url": "",
|
"internal_url": product_subscription_internal_url,
|
||||||
|
"external_url": product_subscription_external_url,
|
||||||
"price_text": "90 days free and 3.95/Month",
|
"price_text": "90 days free and 3.95/Month",
|
||||||
"product_id": product_data.product_id,
|
"product_id": product_data.product_id,
|
||||||
"product_name": product_data.name,
|
"product_name": product_data.name,
|
||||||
|
|||||||
@@ -100,13 +100,26 @@ class OfficeDashboardService(BaseService):
|
|||||||
# "recent_transactions": recent_transactions_data
|
# "recent_transactions": recent_transactions_data
|
||||||
# }
|
# }
|
||||||
subscription = MembersProducts.get_dash_recent_subscription(15)
|
subscription = MembersProducts.get_dash_recent_subscription(15)
|
||||||
dashboard_data = {
|
|
||||||
|
|
||||||
|
subscription_data = [{
|
||||||
|
'id': t.id,
|
||||||
|
'uid': t.uid,
|
||||||
|
'product_id': t.product_id,
|
||||||
|
'internal_url': t.internal_url,
|
||||||
|
'external_url': t.external_url,
|
||||||
|
'dns_group': t.dns_group,
|
||||||
|
'status': t.status,
|
||||||
|
'added': t.added,
|
||||||
|
'updated': t.updated
|
||||||
|
} for t in subscription]
|
||||||
|
|
||||||
|
dashboard_data = {
|
||||||
|
"subscription":subscription_data,
|
||||||
"loans": {
|
"loans": {
|
||||||
"currency": "Naira",
|
"currency": "Naira",
|
||||||
"currency_text": "\u20a6",
|
"currency_text": "\u20a6",
|
||||||
"text": "this week",
|
"text": "this week",
|
||||||
"value": 15000.0
|
"value": 159999.0
|
||||||
},
|
},
|
||||||
"payments": {
|
"payments": {
|
||||||
"currency": "Naira",
|
"currency": "Naira",
|
||||||
|
|||||||
@@ -35,22 +35,35 @@ class ProductsService(BaseService):
|
|||||||
member_data = Members.get_member_by_uid(uid)
|
member_data = Members.get_member_by_uid(uid)
|
||||||
member_id = member_data.id
|
member_id = member_data.id
|
||||||
# get user subscription
|
# get user subscription
|
||||||
member_subs = MembersProducts.get_member_productlist_by_member_id(member_id)
|
member_subs_data =[]
|
||||||
|
product_status=[]
|
||||||
|
|
||||||
|
# member_subs = MembersProducts.get_member_productlist_by_member_id(member_id)
|
||||||
|
# for t in member_subs:
|
||||||
|
# member_subs_data.append({
|
||||||
|
# 'product_id': t.product_id,
|
||||||
|
# 'status': t.status,
|
||||||
|
# 'internal_url': t.internal_url,
|
||||||
|
# 'dns_group': t.dns_group,
|
||||||
|
# })
|
||||||
|
# product_status[t.product_id] = t.status
|
||||||
|
|
||||||
products = Products.get_user_product_list(member_id)
|
products = Products.get_user_product_list(member_id)
|
||||||
product_data=[]
|
product_data=[]
|
||||||
logger.info(f"Product Data ****** *****: {products}")
|
logger.info(f"Product Data ****** *****: {products}")
|
||||||
|
|
||||||
for t in products:
|
for t in products:
|
||||||
|
currentStatus = t.status
|
||||||
|
|
||||||
st_text = "Activate Now"
|
st_text = "Activate Now"
|
||||||
# match str(t.status):
|
# match str(t.status):
|
||||||
if t.status == 1:
|
if currentStatus == 1:
|
||||||
st_text = "Coming Soon"
|
st_text = "Coming Soon"
|
||||||
|
|
||||||
if t.status == 5:
|
if currentStatus == 5:
|
||||||
st_text = "Activate Now"
|
st_text = "Activate Now"
|
||||||
|
|
||||||
if t.status == 6:
|
if currentStatus == 6:
|
||||||
st_text = "Creating"
|
st_text = "Creating"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class MembersProducts(db.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_dash_recent_subscription(cls, limit):
|
def get_dash_recent_subscription(cls, limit):
|
||||||
member_product = cls.query.limit(limit).all()
|
member_product = cls.query.order_by(cls.id.desc()).limit(limit).all()
|
||||||
if not member_product:
|
if not member_product:
|
||||||
return None
|
return None
|
||||||
return member_product
|
return member_product
|
||||||
|
|||||||
Reference in New Issue
Block a user