Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow accounts loadpolicies command to be run on its own #839

Merged
merged 1 commit into from
Oct 25, 2016
Merged

Allow accounts loadpolicies command to be run on its own #839

merged 1 commit into from
Oct 25, 2016

Conversation

karenc
Copy link
Contributor

@karenc karenc commented Oct 16, 2016

Proposed changes in this pull request

  • Add arguments for accounts loadpolicies command

    Without the arguments, when running python manage.py loadpolicies, you
    get a KeyError:

    Traceback (most recent call last):
    File "manage.py", line 10, in <module>
      execute_from_command_line(sys.argv)
    File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
      utility.execute()
    File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
      output = self.handle(*args, **options)
    File "/home/karen/cadasta-platform/cadasta/accounts/management/commands/loadpolicies.py", line 10, in handle
      load.run(force=options['force'], update=options['update'])
    KeyError: 'force'
    

    Close Error running manage.py loadpolicies #836

When should this PR be merged

When review is complete.

Risks

There shouldn't be any.

Follow up actions

If this pull request is accepted, we should look at other management/commands directories for other commands that have the same problem.

Without the arguments, when running `python manage.py loadpolicies`, you
get a `KeyError`:

```
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/karen/cadasta/env/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/home/karen/cadasta-platform/cadasta/accounts/management/commands/loadpolicies.py", line 10, in handle
    load.run(force=options['force'], update=options['update'])
KeyError: 'force'
```

Close #836
@oliverroick oliverroick merged commit 8d37f9a into Cadasta:master Oct 25, 2016
@oliverroick
Copy link
Member

@karenc Good stuff, thanks for spotting and fixing this. It is much appreciated!

@karenc karenc deleted the fix-loadpolicies branch October 31, 2016 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants