Skip to content

Instantly share code, notes, and snippets.

View inoryy's full-sized avatar
:octocat:

Roman Ring inoryy

:octocat:
View GitHub Profile
@inoryy
inoryy / tf_seq2seq_single_str_inference.py
Created May 12, 2017 11:54 — forked from noname01/tf_seq2seq_single_str_inference.py
Quick hack for loading seq2seq model and inference via feed_dict.
from pydoc import locate
import tensorflow as tf
import numpy as np
from seq2seq import tasks, models
from seq2seq.training import utils as training_utils
from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
class DecodeOnce(InferenceTask):
'''

Redirecting to last visited page after registration.

Imagine this scenario: A user on your webpage finds an awesome link, but it's only open to registered users.

Normally our user will be redirected to login page and if they already have an account, they can login and get redirected to the page they were looking for. This is possible thanks to Symfony2 Authentication listener where a session parameter is set to what the last page was before firewall was hit and then purged the moment you login.

But what if they're a new user? After clicking another link to register and filling out the form, how can you redirect them back to the page they're actually looking for?