.
This commit is contained in:
@@ -97,7 +97,7 @@
|
|||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
if (data.status == "success") {
|
if (data.status == "success") {
|
||||||
toastr.info('Added');
|
toastr.info('Added/Updated');
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
// show some message according to the response.
|
// show some message according to the response.
|
||||||
|
|||||||
+5
-1
@@ -963,7 +963,6 @@ def manage_cid_users(request):
|
|||||||
|
|
||||||
selected_cids = json.loads(request.POST.get("selected_cids"))
|
selected_cids = json.loads(request.POST.get("selected_cids"))
|
||||||
|
|
||||||
new_cid = max(CidUser.objects.all().order_by("-cid")[0].cid + 1, 50000)
|
|
||||||
|
|
||||||
number_to_create = int(request.POST.get("number_to_create"))
|
number_to_create = int(request.POST.get("number_to_create"))
|
||||||
|
|
||||||
@@ -1022,6 +1021,11 @@ def manage_cid_users(request):
|
|||||||
c.save()
|
c.save()
|
||||||
return JsonResponse({"status": "success"})
|
return JsonResponse({"status": "success"})
|
||||||
|
|
||||||
|
try:
|
||||||
|
new_cid = CidUser.objects.all().order_by("-cid")[0].cid + 1
|
||||||
|
except IndexError:
|
||||||
|
new_cid = 10000
|
||||||
|
|
||||||
for n in range(number_to_create):
|
for n in range(number_to_create):
|
||||||
passcode = "".join(random.choices(string.ascii_uppercase, k=4))
|
passcode = "".join(random.choices(string.ascii_uppercase, k=4))
|
||||||
c = CidUser(cid=new_cid, passcode=passcode)
|
c = CidUser(cid=new_cid, passcode=passcode)
|
||||||
|
|||||||
Reference in New Issue
Block a user