Use get_or_create in place of create_or_get

Peewee v2.9.0 removes the create_or_get method.
This commit is contained in:
Brad Ison 2018-02-28 17:19:10 -05:00
parent c2ad6c5060
commit 8e5c67e207
No known key found for this signature in database
GPG key ID: 972D14B0BE6DE287

View file

@ -2,10 +2,10 @@ from data.database import QuayRelease, QuayRegion, QuayService
def set_region_release(service_name, region_name, version):
service, _ = QuayService.create_or_get(name=service_name)
region, _ = QuayRegion.create_or_get(name=region_name)
service, _ = QuayService.get_or_create(name=service_name)
region, _ = QuayRegion.get_or_create(name=region_name)
return QuayRelease.create_or_get(service=service, version=version, region=region)
return QuayRelease.get_or_create(service=service, version=version, region=region)
def get_recent_releases(service_name, region_name):