MT#56508 repoapi: fix jbi rows with projectname with '-gerrit'

jenkins was sending the wrong projectname fixed at
https://gerrit.mgm.sipwise.com/c/puppet-sipwise/+/67011

Change-Id: I0314fee760e2534a50e7399a229e8d6901ec7e1b
pull/10/head
Victor Seva 2 years ago
parent 6bab2c28c2
commit deb4eac730

@ -0,0 +1,23 @@
import re
from django.db import migrations
RE_GERRIT = re.compile("-gerrit$")
def forwards_func(apps, schema_editor):
JenkinsBuildInfo = apps.get_model("repoapi", "JenkinsBuildInfo")
qs = JenkinsBuildInfo.objects.filter(projectname__endswith="-gerrit")
for jbi in qs:
jbi.update(projectname=RE_GERRIT.sub("", jbi.projectname))
class Migration(migrations.Migration):
dependencies = [
("repoapi", "0013_mantisnoteinfo"),
]
operations = [
migrations.RunPython(forwards_func),
]
Loading…
Cancel
Save