# django__django-13315
# Loki Mode Multi-Agent Patch
# Attempts: 1

--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -1055,6 +1055,10 @@ class ForeignKey(ForeignObject):
             "queryset": self.remote_field.model._default_manager.using(using),
             "to_field_name": self.remote_field.field_name,
         }
+        if self.remote_field.limit_choices_to:
+            # Use distinct() to avoid duplicate options when limit_choices_to
+            # involves a join that can multiply rows.
+            defaults["queryset"] = defaults["queryset"].distinct()
         defaults.update(kwargs)
         return super().formfield(**defaults)