﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	parents
5437	blog media_type uses inconsistent naming	ayleph	ayleph	"The blog media_type hasn't been working for quite some time due to naming conflicts. The problem was introduced in [http://git.savannah.gnu.org/gitweb/?p=mediagoblin.git;a=commitdiff;h=511ce0d6c755dbdbe4f045f20fd57164584958f3 511ce0d]when `mediagoblin/media_types/blog/__init__.py` was changed as below.

{{{
--- a/mediagoblin/media_types/blog/__init__.py
+++ b/mediagoblin/media_types/blog/__init__.py
@@ -18,7 +18,7 @@ from mediagoblin.media_types import MediaManagerBase

 from mediagoblin.tools import pluginapi

-MEDIA_TYPE = 'mediagoblin.media_types.blog'
+MEDIA_TYPE = 'mediagoblin.media_types.blogpost'
}}}

This causes new blog entries to be added to `core__media_entries` with `media_type = mediagoblin.media_types.blogpost`. However, all the blog code is located at `mediagoblin/media_types/blog`. This causes server errors like below.

{{{
...
File '/path/to/mediagoblin/mediagoblin/db/models.py', line 665 in media_data
  return getattr(self, self.media_data_ref)
File 'build/bdist.linux-x86_64/egg/sqlalchemy/util/langhelpers.py', line 754 in __get__
File '/path/to/mediagoblin/mediagoblin/db/models.py', line 687 in media_data_ref
  return import_component(self.media_type + '.models:BACKREF_NAME')
File '/path/to/mediagoblin/mediagoblin/tools/common.py', line 34 in import_component
  __import__(module_name)
ImportError: No module named blogpost.models
}}}

I fixed this long ago on one of my instances. I'll post the patch and migration that would be required to fix it on someone else's instance."	defect	in_progress	major		programming		blog,models,error		5438
