

def formfield_for_foreignkey(self, db_field, request, **kwargs):
    if ((db_field.name == 'user') and (not db_field.user.is_superuser)):
        kwargs['queryset'] = User.objects.filter(pk=request.user.pk)
        return db_field.formfield(**kwargs)
    return super(LifestreamAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

dataset/ETHPy150Open IanLewis/django-lifestream/lifestream/admin.py LifestreamAdmin.formfield_for_foreignkey/VarMisuse@29/40 `request`->`db_field`