Formatting and syntax improvements
This commit is contained in:
parent
fa57100cd5
commit
7d0be20842
3 changed files with 15 additions and 16 deletions
|
@ -10,14 +10,12 @@ def set_region_release(service_name, region_name, version):
|
|||
|
||||
def get_recent_releases(service_name, region_name):
|
||||
return (QuayRelease
|
||||
.select(QuayRelease)
|
||||
.join(QuayService)
|
||||
.switch(QuayRelease)
|
||||
.join(QuayRegion)
|
||||
.where(
|
||||
QuayService.name == service_name,
|
||||
QuayRegion.name == region_name,
|
||||
QuayRelease.reverted == False,
|
||||
)
|
||||
.order_by(QuayRelease.created.desc())
|
||||
)
|
||||
.select(QuayRelease)
|
||||
.join(QuayService)
|
||||
.switch(QuayRelease)
|
||||
.join(QuayRegion)
|
||||
.where(QuayService.name == service_name,
|
||||
QuayRegion.name == region_name,
|
||||
QuayRelease.reverted == False,
|
||||
)
|
||||
.order_by(QuayRelease.created.desc()))
|
||||
|
|
|
@ -97,17 +97,17 @@ def create_v1_storage(location_name):
|
|||
return storage
|
||||
|
||||
|
||||
def find_or_create_storage_signature(storage, signature_kind):
|
||||
found = lookup_storage_signature(storage, signature_kind)
|
||||
def find_or_create_storage_signature(storage, signature_kind_name):
|
||||
found = lookup_storage_signature(storage, signature_kind_name)
|
||||
if found is None:
|
||||
kind = ImageStorageSignatureKind.get(name=signature_kind)
|
||||
kind = ImageStorageSignatureKind.get(name=signature_kind_name)
|
||||
found = ImageStorageSignature.create(storage=storage, kind=kind)
|
||||
|
||||
return found
|
||||
|
||||
|
||||
def lookup_storage_signature(storage, signature_kind):
|
||||
kind = ImageStorageSignatureKind.get(name=signature_kind)
|
||||
def lookup_storage_signature(storage, signature_kind_name):
|
||||
kind = ImageStorageSignatureKind.get(name=signature_kind_name)
|
||||
try:
|
||||
return (ImageStorageSignature
|
||||
.select()
|
||||
|
|
|
@ -368,6 +368,7 @@ def lookup_federated_login(user, service_name):
|
|||
except FederatedLogin.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
def create_confirm_email_code(user, new_email=None):
|
||||
if new_email:
|
||||
if not validate_email(new_email):
|
||||
|
|
Reference in a new issue