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) pkg.herds.add(herd)
for maintainer in pkg.maintainers.all(): for maintainer in pkg.maintainers.all():
if maintainer.email in old_maintainers: email = maintainer.email
if email in old_maintainers:
pkg.maintainers.remove(maintainer) 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: for maintainer in new_maintainers:
maintainer = maintainers[maintainer] maintainer = maintainers[maintainer]
@ -215,9 +221,15 @@ class ScanMetadata(object):
maintainer_name = maintainer_node.findtext('name') maintainer_name = maintainer_node.findtext('name')
maintainer_email = maintainer_node.findtext('email') maintainer_email = maintainer_node.findtext('email')
maintainer = self.store_maintainer( try:
maintainer_name, maintainer_email 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) herd.maintainers.add(maintainer)

View File

@ -386,7 +386,7 @@ def populate_overlays(logger):
if not overlay: if not overlay:
continue continue
obj, created = Overlay.objects.get_or_create(name=overlay) 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.description = info[overlay]["description"]
obj.homepage = info[overlay]["homepage"] obj.homepage = info[overlay]["homepage"]
obj.overlay_path = os.path.join(l.config['storage'], overlay) obj.overlay_path = os.path.join(l.config['storage'], overlay)