diff --git a/shelfzilla/apps/account/views.py b/shelfzilla/apps/account/views.py index e8c6697..2b03f89 100644 --- a/shelfzilla/apps/account/views.py +++ b/shelfzilla/apps/account/views.py @@ -148,8 +148,13 @@ class RegisterView(View): form_class = RegistrationForm def get(self, request): + form_data = {} + + if 'code' in request.GET: + form_data['access_code'] = request.GET['code'] + data = { - 'form': self.form_class + 'form': self.form_class(initial=form_data) } ctx = RequestContext(request, data) diff --git a/shelfzilla/themes/bootflat/templates/account/register.html b/shelfzilla/themes/bootflat/templates/account/register.html index 1113b10..8b117d3 100644 --- a/shelfzilla/themes/bootflat/templates/account/register.html +++ b/shelfzilla/themes/bootflat/templates/account/register.html @@ -15,7 +15,7 @@

{% trans "Register" %}

-
+ {% csrf_token %} {% for field in form %}