Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(controller): fix NoneType config values
Browse files Browse the repository at this point in the history
if `Release.new` is called without new configuration data (i.e.
config = None), the if statements will be skipped because a
NoneType in Python means that the variable still has a value,
which is not the intended behavior. Explicitly checking if
config or build is a NoneType fixes this behavior.

TESTING: rebuild the controller with this change and push an app:

    $ deis create test
    $ git push deis master

then, test that a 'v2' tag was successfully created in the registry:

    $ curl local.deisapp.com:5000/v1/repositories/test/tags
    {"latest": "ed14150269724148851d54d5f3ed104ced14150269724148851d54d5f3ed104c",
     "v2": "ed14150269724148851d54d5f3ed104ced14150269724148851d54d5f3ed104c"}

fixes #950
  • Loading branch information
Matthew Fisher committed May 9, 2014
1 parent f1229d2 commit 09e5c0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ def new(self, user, config=None, build=None, summary=None):
Releases start at v1 and auto-increment.
"""
if not config:
if config is None:
config = self.config
if not build:
if build is None:
build = self.build
# prepare release tag
new_version = self.version + 1
Expand Down

0 comments on commit 09e5c0c

Please sign in to comment.