on améliore la gestion des dupliqués
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
				
			|||||||
{% extends "agenda_culturel/page.html" %}
 | 
					{% extends "agenda_culturel/page.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load utils_extra %}
 | 
					{% load utils_extra %}
 | 
				
			||||||
 | 
					{% load event_extra %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block title %}Événements possiblement dupliqués{% endblock %}
 | 
					{% block title %}Événements possiblement dupliqués{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,7 +25,7 @@
 | 
				
			|||||||
        </header>
 | 
					        </header>
 | 
				
			||||||
        <ul>
 | 
					        <ul>
 | 
				
			||||||
        {% for e in events %}
 | 
					        {% for e in events %}
 | 
				
			||||||
            <li>{{ e.start_day }}{% if e.start_time %} à {{ e.start_time }}{% endif %} : <a href="{{ e.get_absolute_url }}">{{ e.title }}</a> créé le {{ e.created_date }}</li>
 | 
					            <li>{{ e.start_day }}{% if e.start_time %} à {{ e.start_time }}{% endif %} : {{ e|picto_status }} <a href="{{ e.get_absolute_url }}">{{ e.title }}</a> créé le {{ e.created_date }}</li>
 | 
				
			||||||
        {% endfor %}
 | 
					        {% endfor %}
 | 
				
			||||||
        </ul>
 | 
					        </ul>
 | 
				
			||||||
        {% if perms.agenda_culturel.change_duplicatedevents %}
 | 
					        {% if perms.agenda_culturel.change_duplicatedevents %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1085,6 +1085,8 @@ def merge_duplicate(request, pk):
 | 
				
			|||||||
            for e in events:
 | 
					            for e in events:
 | 
				
			||||||
                e.status = Event.STATUS.TRASH
 | 
					                e.status = Event.STATUS.TRASH
 | 
				
			||||||
            Event.objects.bulk_update(events, fields=["status"])
 | 
					            Event.objects.bulk_update(events, fields=["status"])
 | 
				
			||||||
 | 
					            # remove duplicate
 | 
				
			||||||
 | 
					            edup.delete()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            messages.info(request, _("The merge has been successfully completed."))
 | 
					            messages.info(request, _("The merge has been successfully completed."))
 | 
				
			||||||
            return HttpResponseRedirect(new_event.get_absolute_url())
 | 
					            return HttpResponseRedirect(new_event.get_absolute_url())
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user