Strip spaces from url when creating or updating a source
This commit is contained in:
parent
a17e8208de
commit
8233b2ec23
|
@ -29,7 +29,7 @@ def harvest_source_create(context,data_dict):
|
|||
raise ValidationError(errors,_error_summary(errors))
|
||||
|
||||
source = HarvestSource()
|
||||
source.url = data['url']
|
||||
source.url = data['url'].strip()
|
||||
source.type = data['type']
|
||||
|
||||
opt = ['active','title','description','user_id','publisher_id','config']
|
||||
|
|
|
@ -47,6 +47,8 @@ def harvest_source_update(context,data_dict):
|
|||
fields = ['url','title','type','description','user_id','publisher_id']
|
||||
for f in fields:
|
||||
if f in data and data[f] is not None:
|
||||
if f == 'url':
|
||||
data[f] = data[f].strip()
|
||||
source.__setattr__(f,data[f])
|
||||
|
||||
if 'active' in data_dict:
|
||||
|
|
Loading…
Reference in New Issue