stefanfoulis/cmsplugin-filer — pull request #84 by kux (2013-01-14 16:22:32+00:00)
Title: Make FileFile.get_file_name cope with sitiuations where self.file.name is not set.

Issue reproduced with:
django-filer==0.9
django-cms==2.3.3
django==1.4.1

Steps to reproduce:
1. Upload a file to filer (foo_file)
2. In any page add a filer file plugin that points to the file you've just added

Expected:
* plugin successfully added

Actual :
AttributeError at /admin/cms/page/2/edit-plugin/8/
'FilerFile' object has no attribute 'name'

File "/home/kux/workspace/src/other/django/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/kux/workspace/src/other/django/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/home/kux/workspace/src/other/django/django/views/decorators/cache.py" in _wrapped_view_func
89. response = view_func(request, *args, **kwargs)
File "/home/kux/workspace/src/other/django/django/contrib/admin/sites.py" in inner
196. return view(request, *args, **kwargs)
File "/home/kux/workspace/envs/contribute/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context
300. return func(*args, **kwargs)
File "/home/kux/workspace/src/other/django-cms/cms/admin/pageadmin.py" in edit_plugin
1296. response = plugin_admin.add_view(request)
File "/home/kux/workspace/src/other/django/django/utils/decorators.py" in _wrapper
25. return bound_func(*args, **kwargs)
File "/home/kux/workspace/src/other/django/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/home/kux/workspace/src/other/django/django/utils/decorators.py" in bound_func
21. return func(self, *args2, **kwargs2)
File "/home/kux/workspace/src/other/django/django/db/transaction.py" in inner
209. return func(*args, **kwargs)
File "/home/kux/workspace/src/other/django/django/contrib/admin/options.py" in add_view
959. return self.response_add(request, new_object)
File "/home/kux/workspace/src/other/django-cms/cms/plugin_base.py" in response_add
178. return super(CMSPluginBase, self).response_add(request, obj)
File "/home/kux/workspace/src/other/django/django/contrib/admin/options.py" in response_add
773. msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj)}
File "/home/kux/workspace/src/other/django/django/utils/encoding.py" in force_unicode
71. s = unicode(s)
File "/home/kux/workspace/src/other/cmsplugin-filer/cmsplugin_filer_file/models.py" in __unicode__
50. return self.get_file_name()
File "/home/kux/workspace/src/other/cmsplugin-filer/cmsplugin_filer_file/models.py" in get_file_name
35. return self.name

Exception Type: AttributeError at /admin/cms/page/2/edit-plugin/8/
Exception Value: 'FilerFile' object has no attribute 'name'