Skip to content

Commit

Permalink
added register next
Browse files Browse the repository at this point in the history
  • Loading branch information
tschellenbach committed Apr 18, 2011
1 parent e4bd1d7 commit 33a4c2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions django_facebook/models.py
Expand Up @@ -25,13 +25,14 @@ def __unicode__(self):
class Meta:
abstract = True

def post_facebook_registration(self):
def post_facebook_registration(self, request):
'''
Behaviour after registering with facebook
'''
url = reverse('facebook_connect')
response = HttpResponseRedirect(url)
response.set_cookie('fresh_registration', self.user.id)
from django_facebook.utils import next_redirect
default_url = reverse('facebook_connect')
response = next_redirect(request, default=default_url, next_key='register_next')
response.set_cookie('fresh_registration', user.id)
return response


Expand Down
1 change: 1 addition & 0 deletions django_facebook/tests/test.py
Expand Up @@ -20,6 +20,7 @@ class UserConnectTest(FacebookTest):
- Retry on facebook connection errors
- Taken username errors
- Next param op mystyle
- unique fb ids
'''
fixtures = ['users.json']

Expand Down
2 changes: 1 addition & 1 deletion django_facebook/views.py
Expand Up @@ -56,7 +56,7 @@ def connect(request):
if action is CONNECT_ACTIONS.CONNECT:
messages.info(request, _("You have connected your account to %s's facebook profile") % facebook_data['name'])
elif action is CONNECT_ACTIONS.REGISTER:
response = user.get_profile().post_facebook_registration()
response = user.get_profile().post_facebook_registration(request)
return response
else:
return next_redirect(request, additional_params=dict(fb_error_or_cancel=1), next_key=['error_next', 'next'])
Expand Down

0 comments on commit 33a4c2e

Please sign in to comment.