Skip to content

Instantly share code, notes, and snippets.

View andymckay's full-sized avatar

Andy McKay andymckay

View GitHub Profile
diff --git a/vendor.pth b/vendor.pth
deleted file mode 100644
index 240bf66..0000000
--- a/vendor.pth
+++ /dev/null
@@ -1 +0,0 @@
-src/django-browserid
diff --git a/zamboni.pth b/zamboni.pth
index 80b031a..e32a130 100644
--- a/zamboni.pth
LOGIN_RATELIMIT_ALL_USERS = '1000/m'
LOGIN_RATELIMIT_USER = 1
>>> ad = Addon.objects.get(pk=2)
>>> ad.is_premium()
True
>>> ad.update(premium_type=amo.ADDON_FREE)
14:02:47 z.task:INFO Indexing addons 2-2. [1] :/Users/andy/sandboxes/zamboni/apps/addons/tasks.py:113
>>> Addon.objects.get(pk=2).is_premium()
False
>>> ad.delete('foo')
------------------------------------------------------------
...
File "/Users/andy/sandboxes/zamboni/apps/search/forms.py", line 262, in <module>
class ESSearchForm(forms.Form):
File "/Users/andy/sandboxes/zamboni/apps/search/forms.py", line 269, in ESSearchForm
choices=[(t, amo.ADDON_TYPE[t]) for t in amo.ADDON_SEARCH_TYPES])
AttributeError: 'module' object has no attribute 'ADDON_SEARCH_TYPES'
diff --git a/media/js/zamboni/contributions.js b/media/js/zamboni/contributions.js
index ca57ee4..b491dff 100644
--- a/media/js/zamboni/contributions.js
+++ b/media/js/zamboni/contributions.js
@@ -33,10 +33,10 @@ $(document).ready(function() {
top_dgFlow = top.dgFlow || (top.opener && top.opener.top.dgFlow);
if (top_dgFlow !== null) {
var thanks_url = $('#paypal-thanks').attr('href');
- top_dgFlow.closeFlow();
if(thanks_url) {
@mock.patch.object(File, 'file_path', '/tmp/foo.bar')
def test_file_path(self):
print File.objects.all()[0].file_path
>>> from access.middleware import ACLMiddleware
>>> ACLMiddleware()(request)
LOGGING = {
'loggers': {
'django.pylibmc': {
'level': 'DEBUG',
'handlers': ['console'],
},
},
}
try:
from settings_local import *
except ImportError:
pass
amo = AMOOAuth(domain="addons.mozilla.org", port=443,
protocol='https', prefix='z')
amo.set_consumer(consumer_key='xxx',
consumer_secret='xxx')
versions = amo.get_versions(212428)
print versions