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:
parent
c2ad6c5060
commit
8e5c67e207
1 changed files with 3 additions and 3 deletions
|
@ -2,10 +2,10 @@ from data.database import QuayRelease, QuayRegion, QuayService
|
||||||
|
|
||||||
|
|
||||||
def set_region_release(service_name, region_name, version):
|
def set_region_release(service_name, region_name, version):
|
||||||
service, _ = QuayService.create_or_get(name=service_name)
|
service, _ = QuayService.get_or_create(name=service_name)
|
||||||
region, _ = QuayRegion.create_or_get(name=region_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):
|
def get_recent_releases(service_name, region_name):
|
||||||
|
|
Reference in a new issue