Archive

Tag Archives: sayan chowdhury

It’s better later than never. It’s been two week since the Google Summer of Code 2013 results were announced and I am glad to say that I got selected this year.

I will be working on Darkserver Improvment under Fedora. One can see a draft of my proposal here. My mentor is Kushal Das and i am really helpful for helping me out in the whole process both in code and application.

This year thought to wish “Happy New Year” in different style. So, here is a Brainfuck program to wish you the same. :)

# Written by Sayan Chowdhury

+++++ +++++
[
    > +++++ ++
    > +++++ +++
    > +++++ ++++
    > +++++ +++++ 
    > +++++ +++++ +
    > +++++ +++++ ++
    > +++
    > +
    <<<<<<<< -
]

> ++ .
>>> --- .
> ++ .
.
> + .
> ++ .

<<<<< -- .
>> ++++ .
>> -- .
> .
<<<< - .
> .
---- .
> ++ .
>>> .

For last few days, I was working on implementing a feature where the users who log in through the social log in methods in Transifex can choose a username, when logging in for the first time. Logically, I had to add in a step in the transifex social_auth_pipeline to display the user with a form to enter the desired username, before the user is created. django-social-auth provides us with Partial Pipeline where one can halt the pipeline process and ask the user for more data, and then resume. As mentioned in the docs:

It’s possible to cut the pipeline process to return to the user asking for more data and resume the process later, to accomplish this add the entry social_auth.backends.pipeline.misc.save_status_to_session (or a similar implementation) to the pipeline setting before any entry that returns an HttpResponse instance

The example below can be used implement partial pipeline

SOCIAL_AUTH_PIPELINE = (
...
social_auth.backends.pipeline.misc.save_status_to_session,
app.pipeline.redirect_to_basic_user_data_form
...
)

After the pipeline resumes, by default the pipeline is resumed from the next entry after save_status_to_session but this can be modified by setting the following setting to the import path of the pipeline entry to resume processing

SOCIAL_AUTH_PIPELINE_RESUME_ENTRY = 'social_auth.backends.pipeline.misc.save_status_to_session'

This comes handy when the user inputs an invalid/duplicate data and one need to cut the pipeline process again. After implementing this feature, I submitted the patch to upstream and hope to get it accepted.

REFERENCE: http://django-social-auth.readthedocs.org/en/latest/pipeline.html

%d bloggers like this: