Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
omitting None values,
Browse files Browse the repository at this point in the history
  • Loading branch information
mvexel committed Jul 5, 2015
1 parent f1e9eac commit 59e46cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maproulette/challenge.py
Expand Up @@ -59,7 +59,9 @@ def exists(self, server):
def as_payload(self):
return {
key:value for key, value in self.__dict__.items()
if not key.startswith('__') and not callable(key)}
if not key.startswith('__')
and not value is None
and not callable(key)}

@classmethod
def from_server(cls, server, slug):
Expand Down
1 change: 1 addition & 0 deletions maproulette/task.py
Expand Up @@ -52,6 +52,7 @@ def as_payload(self, with_identifier=False):
payload = {
key:value for key, value in self.__dict__.items()
if not key.startswith('__')
and not value is None
and not callable(key)}
if with_identifier:
payload['identifier'] = self.__identifier__
Expand Down

0 comments on commit 59e46cc

Please sign in to comment.