diff --git a/oef/templates/oef/formats_dupe_view.html b/oef/templates/oef/formats_dupe_view.html
new file mode 100644
index 00000000..cccedae1
--- /dev/null
+++ b/oef/templates/oef/formats_dupe_view.html
@@ -0,0 +1,21 @@
+
+{% extends 'oef/base.html' %}
+
+
+
+{% block content %}
+
Formats
+
+
+
+ {% for dupe in dupes %}
+ {{dupe}}
+
+ {% endfor %}
+
+
+
+
+
+{% endblock content %}
+
\ No newline at end of file
diff --git a/oef/templates/oef/formats_view.html b/oef/templates/oef/formats_view.html
index 1a62e34a..6745c2a1 100644
--- a/oef/templates/oef/formats_view.html
+++ b/oef/templates/oef/formats_view.html
@@ -6,6 +6,7 @@
{% block content %}
Formats
Create a new format
+View dupes
{% for format in formats %}
diff --git a/oef/urls.py b/oef/urls.py
index 9035cbc0..ba104dc0 100644
--- a/oef/urls.py
+++ b/oef/urls.py
@@ -17,6 +17,9 @@ urlpatterns = [
path(
"formats", views.formats_view, name="formats_view"
),
+ path(
+ "formats/dupes", views.formats_dupe_view, name="formats_dupe_view"
+ ),
path(
"formats/create", views.FormatsCreateView.as_view(), name="format_create"
),
diff --git a/oef/views.py b/oef/views.py
index c3ecc90e..5dccddff 100644
--- a/oef/views.py
+++ b/oef/views.py
@@ -1,3 +1,4 @@
+from collections import defaultdict
from dataclasses import dataclass
from difflib import HtmlDiff, SequenceMatcher
from django import forms
@@ -141,6 +142,23 @@ def formats_view(request):
formats = Formats.objects.all()
return render(request, "oef/formats_view.html", {"formats": formats})
+def formats_dupe_view(request):
+ formats = Formats.objects.all()
+
+ format_dict = defaultdict(list)
+
+ dupes = []
+
+ for format in formats:
+ if format.format in format_dict:
+ dupes.append(format)
+ format_dict[format.format].append(format)
+
+
+
+
+ return render(request, "oef/formats_dupe_view.html", {"dupes": dupes, "format_dict": format_dict})
+
@user_passes_test(lambda u: u.is_superuser)
def formats_delete(request, pk):