mirror of https://github.com/sipwise/repoapi.git
jenkins was sending the wrong projectname fixed at https://gerrit.mgm.sipwise.com/c/puppet-sipwise/+/67011 Change-Id: I0314fee760e2534a50e7399a229e8d6901ec7e1bpull/10/head
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…
Reference in new issue