Fix cheat
This commit is contained in:
@@ -11,6 +11,20 @@ from core.models import Ad
|
||||
from core.views.helpers import synchronize_async_helper
|
||||
|
||||
|
||||
class Cheat(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
template_name = "mixins/partials/notify.html"
|
||||
|
||||
def get(self, request):
|
||||
ads = Ad.objects.filter(user=request.user, enabled=True)
|
||||
for ad in ads:
|
||||
for platform in ad.platforms.all():
|
||||
run = synchronize_async_helper(AgoraClient(platform))
|
||||
synchronize_async_helper(run.cheat())
|
||||
|
||||
context = {"class": "success", "message": "Cheat run"}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class AdNuke(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
template_name = "mixins/partials/notify.html"
|
||||
|
||||
@@ -21,7 +35,7 @@ class AdNuke(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
run = synchronize_async_helper(AgoraClient(platform))
|
||||
synchronize_async_helper(run.nuke_ads())
|
||||
|
||||
context = {"class": "success", "message": "Nuking ads"}
|
||||
context = {"class": "success", "message": "Ads nuked"}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
@@ -35,7 +49,7 @@ class AdDist(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
run = synchronize_async_helper(AgoraClient(platform))
|
||||
synchronize_async_helper(run.dist_countries(ad))
|
||||
|
||||
context = {"class": "success", "message": "Distributing ads"}
|
||||
context = {"class": "success", "message": "Ads distributed"}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
@@ -49,7 +63,7 @@ class AdRedist(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
run = synchronize_async_helper(AgoraClient(platform))
|
||||
synchronize_async_helper(run.redist_countries(ad))
|
||||
|
||||
context = {"class": "success", "message": "Updating ads"}
|
||||
context = {"class": "success", "message": "Ads updated"}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
@@ -80,6 +94,13 @@ class AdList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
"label": "Update ads",
|
||||
"icon": "fa-solid fa-refresh",
|
||||
},
|
||||
{
|
||||
"url": reverse("cheat"),
|
||||
"action": "cheat",
|
||||
"method": "get",
|
||||
"label": "Run cheat",
|
||||
"icon": "fa-solid fa-bolt",
|
||||
},
|
||||
{
|
||||
"url": reverse("ad_nuke"),
|
||||
"action": "nuke",
|
||||
|
||||
@@ -50,7 +50,7 @@ class RequestBankFetch(LoginRequiredMixin, OTPRequiredMixin, View):
|
||||
|
||||
class ReqsList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
list_template = "partials/aggregator-info.html"
|
||||
page_title = "Aggregator Info"
|
||||
page_title = "Aggregator info"
|
||||
|
||||
context_object_name_singular = "requisition"
|
||||
context_object_name = "requisitions"
|
||||
|
||||
@@ -17,7 +17,7 @@ class BanksCurrencies(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
"""
|
||||
|
||||
list_template = "partials/banks-currencies-list.html"
|
||||
page_title = "Bank Currencies"
|
||||
page_title = "Bank currencies"
|
||||
|
||||
context_object_name_singular = "currency"
|
||||
context_object_name = "currencies"
|
||||
@@ -58,7 +58,7 @@ class BanksBalances(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
"""
|
||||
|
||||
list_template = "partials/banks-balances-list.html"
|
||||
page_title = "Bank Balances"
|
||||
page_title = "Bank balances"
|
||||
|
||||
context_object_name_singular = "balance"
|
||||
context_object_name = "balances"
|
||||
@@ -100,7 +100,7 @@ class BanksTransactions(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
"""
|
||||
|
||||
list_template = "partials/banks-transactions-list.html"
|
||||
page_title = "Bank Transactions"
|
||||
page_title = "Bank transactions"
|
||||
|
||||
context_object_name_singular = "transaction"
|
||||
context_object_name = "transactions"
|
||||
|
||||
Reference in New Issue
Block a user