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

Migration jango2.2 py3.7 zabra fix #50

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions zebra/templatetags/zebra_tags.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.urlresolvers import reverse
from django.urls import reverse
from django import template
from django.template.loader import render_to_string
from django.utils.encoding import force_unicode
from django.utils.encoding import force_text as force_unicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _

Expand All @@ -10,12 +10,13 @@

register = template.Library()


def _set_up_zebra_form(context):
if not "zebra_form" in context:
if "form" in context:
context["zebra_form"] = context["form"]
else:
raise Exception, "Missing stripe form."
raise Exception("Missing stripe form.")
context["STRIPE_PUBLISHABLE"] = options.STRIPE_PUBLISHABLE
return context

Expand Down
6 changes: 3 additions & 3 deletions zebra/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import patterns, url
from django.conf.urls import url

from zebra import views

urlpatterns = patterns('',
urlpatterns = [
url(r'webhooks/$', views.webhooks, name='webhooks'),
url(r'webhooks/v2/$', views.webhooks_v2, name='webhooks_v2'),
)
]
4 changes: 2 additions & 2 deletions zebra/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
except:
from django.utils import simplejson

from django.db.models import get_model
from django.apps import apps
import stripe
from zebra.conf import options
from zebra.signals import *
Expand All @@ -17,7 +17,7 @@

def _try_to_get_customer_from_customer_id(stripe_customer_id):
if options.ZEBRA_CUSTOMER_MODEL:
m = get_model(*options.ZEBRA_CUSTOMER_MODEL.split('.'))
m = apps.get_model(*options.ZEBRA_CUSTOMER_MODEL.split('.'))
try:
return m.objects.get(stripe_customer_id=stripe_customer_id)
except:
Expand Down
1 change: 0 additions & 1 deletion zebra/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class Media:
js = ('zebra/card-form.js', 'https://js.stripe.com/v1/')



class NoNameTextInput(TextInput, NoNameWidget):

def render(self, name, *args, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions zebra_sample_project/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf.urls.defaults import patterns, include, url
from django.conf.urls.defaults import include, url

urlpatterns = patterns('',
urlpatterns = [
url(r'zebra/', include('zebra.urls', namespace="zebra", app_name='zebra') ),
url(r'', include('marty.urls', namespace="marty", app_name='marty') ),
)
]