1.0.9 subscribe buy routines
This commit is contained in:
@@ -9,7 +9,7 @@ def get_cur_user_subscribe(user):
|
||||
|
||||
user_subscribe = None
|
||||
try:
|
||||
user_subscribe = SubscribeForUser.objects.get(user=user)
|
||||
user_subscribe = SubscribeForUser.objects.get(enable=True, user=user)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
@@ -38,11 +38,14 @@ def check_n_enable_subscribe_by_order(order):
|
||||
'paid_period_from_DT': datetime.now(),
|
||||
'paid_period_to_DT': datetime.now() + timedelta(hours=order.subscribe.period),
|
||||
'receive_finish_subscribe_msg': True,
|
||||
'enable': True,
|
||||
}
|
||||
subscribe_for_user = SubscribeForUser.objects.create(**kwargs)
|
||||
order.subscribe_for_user = subscribe_for_user
|
||||
order.save()
|
||||
|
||||
SubscribeForUser.objects.exclude(id=subscribes_for_user).update(enable=False)
|
||||
|
||||
subscribes_for_user = [subscribe_for_user]
|
||||
|
||||
return subscribes_for_user
|
||||
@@ -89,7 +92,7 @@ def get_profile_subscribe_page_content_Dict(request):
|
||||
|
||||
|
||||
if not subscribes_for_user:
|
||||
subscribes_for_user = SubscribeForUser.objects.filter(user=request.user)
|
||||
subscribes_for_user = SubscribeForUser.objects.filter(enable=True, user=request.user)
|
||||
|
||||
if not subscribes_for_user:
|
||||
tpl_name = 'blocks/profile/b_subscribe_variants.html'
|
||||
|
||||
Reference in New Issue
Block a user