예제 #1
0
def confirm(request, key):
    try:
        su = signup_model.get_signup_by_invite_code(key)
        unsubscribe_model.unsubscribe_user(su['email'])
        messages.success(request, 'You have been successfully unsubscribed.')
    except:
        log.error(u'Could not find signup for confirmation code {0}'.format(key))
        messages.error(request, 'We could not find the signup that corresponds to the unsubscribe link you used.')
    return http.HttpResponseRedirect(reverse('home'))
예제 #2
0
def confirm(request, key):
    try:
        su = signup_model.get_signup_by_invite_code(key)
        unsubscribe_model.unsubscribe_user(su['email'])
        messages.success(request, 'You have been successfully unsubscribed.')
    except:
        log.error(u'Could not find signup for confirmation code {0}'.format(key))
        messages.error(request, 'We could not find the signup that corresponds to the unsubscribe link you used.')
    return http.HttpResponseRedirect(reverse('home'))
예제 #3
0
 def call_view(*args, **kwargs):
     request = args[0]
     key = request.GET.get('key', None)
     if not key:
         return method(*args, **kwargs)
     try:
         su = signup_api.get_signup_by_invite_code(key)
     except:
         return method(*args, **kwargs)
     request.session['user_email'] = su['email']
     if request.session.get('user_bio'):
         del request.session['user_bio']
     # get the user bio if possible
     try:
         request.session['user_bio'] = classphoto_api.get_bio(su['email'])
     except:
         pass
     return http.HttpResponseRedirect(request.path)
예제 #4
0
 def call_view(*args, **kwargs):
     request = args[0]
     key = request.GET.get('key', None)
     if not key:
         return method(*args, **kwargs)
     try:
         su = signup_api.get_signup_by_invite_code(key)
     except:
         return method(*args, **kwargs)
     request.session['user_email'] = su['email']
     if request.session.get('user_bio'):
         del request.session['user_bio']
     # get the user bio if possible
     try:
         request.session['user_bio'] = classphoto_api.get_bio(su['email'])
     except:
         pass
     return http.HttpResponseRedirect(request.path)