1.3.2 send_mail_for_user_subscribes_that_is_going_to_finish
This commit is contained in:
@@ -22,65 +22,9 @@ def test_code(request):
|
||||
|
||||
res = None
|
||||
|
||||
# import allauth
|
||||
# from allauth.socialaccount.models import SocialApp
|
||||
# apps = SocialApp.objects.all()
|
||||
# apps.delete()
|
||||
from SubscribesApp.reports import send_mail_for_user_subscribes_that_is_going_to_finish
|
||||
send_mail_for_user_subscribes_that_is_going_to_finish()
|
||||
|
||||
# from PushMessages.views import send_push
|
||||
# send_push(request.user, 'test_title', 'test_content')
|
||||
|
||||
# from BaseModels.pay_systems.DVL_Group_kaz.api.funcs import create_order
|
||||
# create_order()
|
||||
|
||||
# from AuthApp.models import User
|
||||
# from SubscribesApp.models import SubscribeForUser, Subscribe
|
||||
# subscribes_null_price = Subscribe.objects.filter(price=0)
|
||||
# if not subscribes_null_price:
|
||||
# res = 'Subscribe not found'
|
||||
# else:
|
||||
# subscribe = subscribes_null_price[0]
|
||||
# users_wo_subscribe = User.objects.filter(rel_userSubscribes_for_user=None)
|
||||
# for user in users_wo_subscribe:
|
||||
# u_sub = SubscribeForUser.objects.create(
|
||||
# user=user,
|
||||
# subscribe=subscribe,
|
||||
# paid_period_from_DT=datetime.now(),
|
||||
# paid_period_to_DT=datetime.now() + timedelta(hours=subscribe.period)
|
||||
# )
|
||||
|
||||
# from RoutesApp.search_matches import search_matches
|
||||
# search_matches()
|
||||
|
||||
# try:
|
||||
# # body = request.body
|
||||
# # data = json.loads(body)
|
||||
# # if 'head' not in data or 'body' not in data or 'id' not in data:
|
||||
# # return JsonResponse(status=400, data={"message": "Invalid data format"})
|
||||
# # user_id = data['id']
|
||||
# user = request.user
|
||||
# payload = {'head': '123', 'body': 'qwerty'}
|
||||
# send_user_notification(user=user, payload=payload, ttl=1000)
|
||||
# return JsonResponse(status=200, data={"message": "Web push successful"})
|
||||
# except TypeError:
|
||||
# return JsonResponse(status=500, data={"message": "An error occurred"})
|
||||
|
||||
# routes = Route.objects.all()
|
||||
#
|
||||
# for route in routes:
|
||||
# print(route.id)
|
||||
# required_save = False
|
||||
# if not route.from_city:
|
||||
# route.from_city = get_city_by_type_transport_and_address_point(route.type_transport, route.from_address_point)
|
||||
# required_save = True
|
||||
#
|
||||
# if not route.to_city:
|
||||
# route.to_city = get_city_by_type_transport_and_address_point(route.type_transport,
|
||||
# route.to_address_point)
|
||||
# required_save = True
|
||||
#
|
||||
# if required_save:
|
||||
# route.save()
|
||||
if res:
|
||||
if type(res) == str:
|
||||
return HttpResponse(res)
|
||||
|
||||
Reference in New Issue
Block a user