Last active
August 29, 2015 13:58
-
-
Save rafen/10027222 to your computer and use it in GitHub Desktop.
MMDBClient error debug for register_app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Settings for local.py | |
# | |
# MMDB_API_HOST = 'http://mc.dev.nationalgeographic.com:8000' | |
# | |
# Load test database in your db. Use production db for this test if possible | |
# $ python manage.py loaddata mmdb/apps/users/fixtures/test_user.json | |
from mmdbcommons.client import MMDBClient, mmdb_client | |
from mmdbcommons.exceptions import AppAlreadyRegisteredError | |
# Create the client | |
client = MMDBClient(api_key='MMDB_DEBUG_KEY', api_user='memcen_debug') | |
try: | |
client.register_app(9617855, 'YourShot') | |
except (AppAlreadyRegisteredError, ): | |
print 'Ignored!' | |
If you need option 1) see the this snippet as an example of how to do it:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Possible Solutions:
Ask YourShot to hit the endpoint directly
Modify the serializer error to raise ERROR_APP_ALREADY_REGISTERED instead of ERROR_DUPLICATE
NOTE: this will require to update unit tests and membercenter code. MMDBClient will work as a result of the changes.