This commit is contained in:
Corentin Chary 2013-07-10 09:43:36 +02:00
parent 0c59e72a8a
commit 55bc34b075
2 changed files with 17 additions and 5 deletions

View File

@ -135,8 +135,14 @@ class ScanMetadata(object):
pkg.herds.add(herd)
for maintainer in pkg.maintainers.all():
if maintainer.email in old_maintainers:
email = maintainer.email
if email in old_maintainers:
pkg.maintainers.remove(maintainer)
if (email in maintainers and
email == maintainer.name and
maintainers[email].name != maintainer.name):
maintainer.name = maintainers[email].name
maintainer.save()
for maintainer in new_maintainers:
maintainer = maintainers[maintainer]
@ -215,9 +221,15 @@ class ScanMetadata(object):
maintainer_name = maintainer_node.findtext('name')
maintainer_email = maintainer_node.findtext('email')
maintainer = self.store_maintainer(
maintainer_name, maintainer_email
)
try:
maintainer = self.store_maintainer(
maintainer_name, maintainer_email
)
except ValidationError:
self.logger.error(
self.style.ERROR("Bad maintainer: '%s' '%s'" % \
(maintainer_name, maintainer_email))
)
herd.maintainers.add(maintainer)

View File

@ -386,7 +386,7 @@ def populate_overlays(logger):
if not overlay:
continue
obj, created = Overlay.objects.get_or_create(name=overlay)
if overlay in info:
if overlay in info and type(info[overlay]) == dict:
obj.description = info[overlay]["description"]
obj.homepage = info[overlay]["homepage"]
obj.overlay_path = os.path.join(l.config['storage'], overlay)