fix subscribe_for_user
This commit is contained in:
SDE
2023-08-31 18:47:06 +03:00
parent d5d702c431
commit 1b809790a2

View File

@@ -42,6 +42,7 @@ def subscribe_now_ajax(request):
subscribe_for_user = SubscribeForUser.objects.filter(user=request.user) subscribe_for_user = SubscribeForUser.objects.filter(user=request.user)
if subscribe_for_user: if subscribe_for_user:
subscribe_for_user.update(**kwargs) subscribe_for_user.update(**kwargs)
subscribe_for_user = subscribe_for_user[0]
else: else:
subscribe_for_user = SubscribeForUser.objects.create(**kwargs) subscribe_for_user = SubscribeForUser.objects.create(**kwargs)
@@ -84,6 +85,7 @@ def show_cur_subscribe_ajax(request):
tpl_name = 'blocks/profile/b_subscribe_variants.html' tpl_name = 'blocks/profile/b_subscribe_variants.html'
else: else:
tpl_name = 'blocks/profile/b_subscribe_current.html' tpl_name = 'blocks/profile/b_subscribe_current.html'
subscribe_for_user = subscribe_for_user[0]
all_options = SubscribeOption.objects.filter(enable=True) all_options = SubscribeOption.objects.filter(enable=True)
subscribes = Subscribe.objects.filter(enable=True) subscribes = Subscribe.objects.filter(enable=True)