diff --git a/ckanext/harvest/lib/__init__.py b/ckanext/harvest/lib/__init__.py index 78a1926..aafe09f 100644 --- a/ckanext/harvest/lib/__init__.py +++ b/ckanext/harvest/lib/__init__.py @@ -189,7 +189,7 @@ def create_harvest_source(data_dict): source.url = data['url'] source.type = data['type'] - opt = ['active','description','user_id','publisher_id','config'] + opt = ['active','title','description','user_id','publisher_id','config'] for o in opt: if o in data and data[o] is not None: source.__setattr__(o,data[o]) @@ -216,9 +216,9 @@ def edit_harvest_source(source_id,data_dict): Session.rollback() raise ValidationError(errors,_error_summary(errors)) - fields = ['url','type','description','user_id','publisher_id'] + fields = ['url','title','type','description','user_id','publisher_id'] for f in fields: - if f in data and data[f] is not None and data[f] != '': + if f in data and data[f] is not None: source.__setattr__(f,data[f]) if 'active' in data_dict: diff --git a/ckanext/harvest/logic/schema.py b/ckanext/harvest/logic/schema.py index 0145c7a..231a530 100644 --- a/ckanext/harvest/logic/schema.py +++ b/ckanext/harvest/logic/schema.py @@ -17,7 +17,8 @@ def default_harvest_source_schema(): 'id': [ignore_missing, unicode, harvest_source_id_exists], 'url': [not_empty, unicode, harvest_source_url_validator], 'type': [not_empty, unicode, harvest_source_type_exists], - 'description': [ignore_missing], + 'title': [ignore_missing,unicode], + 'description': [ignore_missing,unicode], 'active': [ignore_missing,harvest_source_active_validator], 'user_id': [ignore_missing], 'publisher_id': [ignore_missing], diff --git a/ckanext/harvest/templates/source/new_source_form.html b/ckanext/harvest/templates/source/new_source_form.html index a455789..d3c5adb 100644 --- a/ckanext/harvest/templates/source/new_source_form.html +++ b/ckanext/harvest/templates/source/new_source_form.html @@ -35,6 +35,12 @@ + +
+ +