Skip to content

Commit

Permalink
Default Message.CODE to None instead of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed May 10, 2019
1 parent cae6452 commit c4acfe5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion squabble/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def register(cls, msg):
Add ``msg`` to the registry, and assign a ``CODE`` value if not
explicitly specified.
"""
if not hasattr(msg, 'CODE'):
if msg.CODE is None:
setattr(msg, 'CODE', cls._next_code())
logger.info('assigning code %s to %s', msg.CODE, msg)

Expand Down Expand Up @@ -98,6 +98,7 @@ class Message:
'This may indicate poor design, consider multiple tables instead.'
"""
TEMPLATE = None
CODE = None

def __init__(self, **kwargs):
self.kwargs = kwargs
Expand Down

0 comments on commit c4acfe5

Please sign in to comment.