<s> try : <EOL> from urllib . parse import unquote <EOL> except ImportError : <EOL> from urllib import unquote <EOL> from django import forms <EOL> from admin_tools . menu . models import Bookmark <EOL> class BookmarkForm ( forms . ModelForm ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , user , * args , ** kwargs ) : <EOL> super ( BookmarkForm , self ) . __init__ ( * args , ** kwargs ) <EOL> self . user = user <EOL> def clean_url ( self ) : <EOL> url = self . cleaned_data [ '<STR_LIT:url>' ] <EOL> return unquote ( url ) <EOL> def save ( self , * args , ** kwargs ) : <EOL> bookmark = super ( BookmarkForm , self ) . save ( <EOL> commit = False , <EOL> * args , <EOL> ** kwargs <EOL> ) <EOL> bookmark . user = self . user <EOL> bookmark . save ( ) <EOL> return bookmark <EOL> class Meta : <EOL> fields = ( '<STR_LIT:url>' , '<STR_LIT:title>' ) <EOL> model = Bookmark </s>
