Commit 6cd09846 authored by PkSM3's avatar PkSM3

[UPDATE] bugfix for europress (text None)

parent 69e5fb9d
...@@ -214,8 +214,6 @@ class NodesChildrenDuplicates(APIView): ...@@ -214,8 +214,6 @@ class NodesChildrenDuplicates(APIView):
limit = int(request.GET.get('limit', 10)) limit = int(request.GET.get('limit', 10))
total = duplicates.count() total = duplicates.count()
# response building # response building
for duplicate in duplicates[offset : offset+limit]:
print(duplicate)
return JsonHttpResponse({ return JsonHttpResponse({
'pagination': { 'pagination': {
'offset': offset, 'offset': offset,
......
...@@ -130,13 +130,9 @@ class Node(CTENode): ...@@ -130,13 +130,9 @@ class Node(CTENode):
def add_resource(self, **kwargs): def add_resource(self, **kwargs):
print("printing arguments for add_resource():") print("printing arguments for add_resource():")
print(kwargs) print(kwargs)
from django.core.files.storage import default_storage from django.core.files.storage import default_storage
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
import os import os
......
...@@ -70,18 +70,20 @@ class EuropressFileParser(FileParser): ...@@ -70,18 +70,20 @@ class EuropressFileParser(FileParser):
if isinstance(text, bytes): if isinstance(text, bytes):
text = text.decode(encoding) text = text.decode(encoding)
format_date_fr = re.compile('\d*\s*\w+\s+\d{4}', re.UNICODE) format_date_fr = re.compile('\d*\s*\w+\s+\d{4}', re.UNICODE)
test_date_fr = format_date_fr.match(text) if text is not None:
test_date_fr = format_date_fr.match(text)
format_date_en = re.compile('\w+\s+\d+,\s+\d{4}', re.UNICODE) format_date_en = re.compile('\w+\s+\d+,\s+\d{4}', re.UNICODE)
test_date_en = format_date_en.match(text) test_date_en = format_date_en.match(text)
format_sect = re.compile('(\D+),', re.UNICODE)
format_sect = re.compile('(\D+),', re.UNICODE) test_sect = format_sect.match(text)
test_sect = format_sect.match(text) format_page = re.compile(', p. (\w+)', re.UNICODE)
test_page = format_page.match(text)
format_page = re.compile(', p. (\w+)', re.UNICODE) else:
test_page = format_page.match(text) test_date_fr = None
test_date_en = None
test_sect = None
test_page = None
if test_date_fr is not None: if test_date_fr is not None:
self.localeEncoding = "fr_FR" self.localeEncoding = "fr_FR"
......
...@@ -44,14 +44,6 @@ function getCookie(name) { ...@@ -44,14 +44,6 @@ function getCookie(name) {
return cookieValue; return cookieValue;
} }
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
// Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
}
}
});
function deleteNode(node_id) { function deleteNode(node_id) {
$.ajax({ $.ajax({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment