diff --git a/ordr2/schemas/__init__.py b/ordr2/schemas/__init__.py index 4e6a6c1..e249e79 100644 --- a/ordr2/schemas/__init__.py +++ b/ordr2/schemas/__init__.py @@ -24,8 +24,11 @@ class CSRFSchema(colander.Schema): ) @classmethod - def as_form(cls, request, url, **kw): + def as_form(cls, request, **kwargs): + url = kwargs.get('url', None) + if not url: + url = request.resource_url(request.context, request.view_name) schema = cls().bind(request=request) - form = deform.Form(schema, action=url, **kw) + form = deform.Form(schema, action=url, **kwargs) return form