Skip to content

Commit

Permalink
fix for
Browse files Browse the repository at this point in the history
Traceback (most recent call last):
  File "./manage.py", line 59, in <module>
    execute_from_command_line(sys.argv)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/ubuntu/gitcoin/gitcoin-37/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 517, in handle
    do_leaderboard()
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 453, in do_leaderboard
    index_terms = bounty_index_terms(b)
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 170, in bounty_index_terms
    for keyword in bounty_to_city(bounty):
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 157, in bounty_to_city
    return list(set(ele['city'] for ele in bounty_to_location(bounty) if ele and ele.get('city')))
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 112, in bounty_to_location
    locations = locations + profile_to_location(username)
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 91, in profile_to_location
    results = profile_to_location_helper(handle)
  File "/home/ubuntu/gitcoin/coin/app/marketing/management/commands/assemble_leaderboards.py", line 99, in profile_to_location_helper
    profiles = Profile.objects.filter(handle=handle.lower())
AttributeError: 'NoneType' object has no attribute 'lower'
  • Loading branch information
owocki committed May 29, 2020
1 parent fd881ee commit eb8fe47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/marketing/management/commands/assemble_leaderboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def profile_to_location(handle):


def profile_to_location_helper(handle):

if not handle:
return []

profiles = Profile.objects.filter(handle=handle.lower())
if handle and profiles.exists():
profile = profiles.first()
Expand Down

0 comments on commit eb8fe47

Please sign in to comment.