Esempio n. 1
0
def delete_orphaned_counts(request):
    remove_old_counts()
    scache.delete_template_cache("texts_dashboard")

    if MULTISERVER_ENABLED:
        server_coordinator.publish_event("scache", "delete_template_cache", ["texts_dashboard"])

    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
Esempio n. 2
0
        version_copy = deepcopy(version)
        version_copy["title"] = "(removed) Shadal on Genesis"
        del version_copy["_id"]
        db.texts.save(version_copy)

        version["chapter"] = version["chapter"][:4]
        db.texts.save(version)

    elif (not version["versionSource"].startswith("http://www.sefaria.org") and
          not version["versionSource"].startswith("http://www.archive.org")):

        titles.add(version["title"])
        version["title"] = "(removed) " + version["title"]
        db.texts.save(version)

links = db.links.find({"refs": {"$regex": "^Shadal on "}})
for link in links:
    parsed = map(parse_ref, link["refs"])
    remove = True
    for p in parsed:
        if (p.get("book", None) == "Shadal on Genesis"
                and p.get("sections", [999])[0] <= 5):
            remove = False
    if remove:
        db.links.remove(link)

for title in list(titles):
    counts.update_text_count(title)

remove_old_counts()
		version["chapter"] = version["chapter"][:4]
		db.texts.save(version)


	elif (not version["versionSource"].startswith("http://www.sefaria.org") and
		not version["versionSource"].startswith("http://www.archive.org")):

		titles.add(version["title"])
		version["title"] = "(removed) " + version["title"] 
		db.texts.save(version)


links = db.links.find({"refs": {"$regex": "^Shadal on "}})
for link in links:
	parsed = map(parse_ref, link["refs"])
	remove = True
	for p in parsed:
		if (p.get("book", None) == "Shadal on Genesis" 
			and p.get("sections", [999])[0] <= 5):
			remove = False
	if remove:
		db.links.remove(link)


for title in list(titles):
	counts.update_full_text_count(title)


remove_old_counts()
Esempio n. 4
0
def delete_orphaned_counts(request):
    remove_old_counts()
    scache.delete_template_cache("texts_dashboard")
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
Esempio n. 5
0
def delete_orphaned_counts(request):
    remove_old_counts()
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
Esempio n. 6
0
def delete_orphaned_counts(request):
    remove_old_counts()
    return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")