Commits

Diego Búrigo Zacarão  committed b74569e

Added custom edit profile form/url

  • Participants
  • Parent commits 41b1dee

Comments (0)

Files changed (2)

File transifex/txcommon/forms.py

+from userena.forms import EditProfileForm as UserenaEditProfileForm
+from userena.utils import get_profile_model
+
+class EditProfileForm(UserenaEditProfileForm):
+
+    class Meta:
+        model = get_profile_model()
+        exclude = ('user', 'privacy',)
+
+

File transifex/urls.py

 from django.contrib import admin
 import authority
 
+from txcommon.forms import EditProfileForm
+
 # Overriding 500 error handler
 handler500 = 'views.server_error'
 
     urlpatterns += patterns('',
         url(r'^accounts/', include('simpleauth.urls')),)
 else:
-    pass
     urlpatterns += patterns('',
+        # Custom EditProfileForm
+        url(r'^accounts/(?P<username>[\.\w]+)/edit/$', 'userena.views.profile_edit', 
+            {'edit_profile_form': EditProfileForm}, 'userena_profile_edit'),
         url(r'^accounts/', include('userena.urls')),
+        
     )
 
 if settings.USE_SOCIAL_LOGIN: