On ajuste la comparaison pour les images FB

This commit is contained in:
Jean-Marie Favreau 2024-09-07 14:37:24 +02:00
parent 8497dff045
commit b6821436e9

View File

@ -844,6 +844,9 @@ class Event(models.Model):
for attr in Event.data_fields(all=True, local_img=False, exact_location=False): for attr in Event.data_fields(all=True, local_img=False, exact_location=False):
values = [getattr(e, attr) for e in events] values = [getattr(e, attr) for e in events]
values = ["" if v is None else v for v in values] values = ["" if v is None else v for v in values]
# only consider fixed part of Facebook urls
if attr == "image":
values = [v.split("?")[0] if "fbcdn.net" in v else v for v in values]
if len(set([str(v) for v in values])) == 1: if len(set([str(v) for v in values])) == 1:
result.append({"similar": True, "key": attr, "values": values[0]}) result.append({"similar": True, "key": attr, "values": values[0]})