diff -r da8cc38cabe9 -r f384c0a42920 app/soc/modules/ghop/models/task.py --- a/app/soc/modules/ghop/models/task.py Sun Nov 08 12:11:14 2009 -0800 +++ b/app/soc/modules/ghop/models/task.py Tue Nov 10 13:59:15 2009 +0100 @@ -43,10 +43,7 @@ """Model for storing all Task tags. """ - #: Each task_type tag is scoped under the program. - scope = db.ReferenceProperty(reference_class=soc.models.linkable.Linkable, - required=True, - collection_name='task_type_tags') + #: Each task_type tag is scoped under the program. order = db.IntegerProperty(required=True, default=0) @@ -147,6 +144,10 @@ def get_or_create(cls, scope, tag_name, order=0): """Get the Tag object that has the tag value given by tag_value. """ + + if not scope: + return None + tag_key_name = cls.__key_name(scope.key().name(), tag_name) existing_tag = cls.get_by_key_name(tag_key_name) if existing_tag is None: