Break out of for-loop when field found

Matching the `return` statement that the previous commit replaced.
This commit is contained in:
Gunnlaugur Þór Briem 2013-07-13 00:34:23 +00:00
parent 6728ba94b3
commit a88432cc28

View file

@ -135,6 +135,7 @@ class PermissionAdmin(admin.ModelAdmin):
if gfk.fk_field == db_field.name:
kwargs['widget'] = GenericForeignKeyRawIdWidget(
gfk.ct_field, self.admin_site._registry.keys())
break
return super(PermissionAdmin, self).formfield_for_dbfield(db_field, **kwargs)
def queryset(self, request):