Commits

Rune Bromer committed 27a5652

Fixed bookmark bugs. The saved url was urlencoded, so we need to decode it
before we save it. Added a clean_url method to the BookmarkForm. fixes #25

  • Participants
  • Parent commits d23c869

Comments (0)

Files changed (1)

admin_tools/menu/forms.py

+import urllib
+
 from django import forms
 
 from admin_tools.menu.models import Bookmark
 
-
 class BookmarkForm(forms.ModelForm):
     """
     This form allows the user to edit bookmarks. It doesn't show the user field.
         super(BookmarkForm, self).__init__(*args, **kwargs)
         self.user = user
 
+    def clean_url(self):
+        url = self.cleaned_data['url']
+        return urllib.unquote(url)
+
     def save(self, *args, **kwargs):
         bookmark = super(BookmarkForm, self).save(commit=False, *args, **kwargs)
         bookmark.user = self.user