fixed urls in views from the participant app

This commit is contained in:
Oskar Hahn 2013-02-01 17:35:27 +01:00
parent 1a2f0a1b5a
commit 6c3eb0f765
3 changed files with 5 additions and 13 deletions

View File

@ -162,7 +162,7 @@ class ItemDelete(DeleteView):
""" """
permission_required = 'agenda.can_manage_agenda' permission_required = 'agenda.can_manage_agenda'
model = Item model = Item
url = 'item_overview' success_url_name = 'item_overview'
def get_answer_options(self): def get_answer_options(self):
if self.object.children.exists(): if self.object.children.exists():

View File

@ -163,8 +163,6 @@ class UserCreateView(CreateView):
model = User model = User
context_object_name = 'edit_user' context_object_name = 'edit_user'
form_class = UserCreateForm form_class = UserCreateForm
success_url = 'user_overview'
apply_url = 'user_edit'
def manipulate_object(self, form): def manipulate_object(self, form):
self.object.username = gen_username( self.object.username = gen_username(
@ -183,8 +181,6 @@ class UserUpdateView(UpdateView):
model = User model = User
context_object_name = 'edit_user' context_object_name = 'edit_user'
form_class = UserUpdateForm form_class = UserUpdateForm
success_url = 'user_overview'
apply_url = 'participant_edit'
class UserDeleteView(DeleteView): class UserDeleteView(DeleteView):
@ -193,7 +189,7 @@ class UserDeleteView(DeleteView):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
model = User model = User
url = 'user_overview' success_url_name = 'user_overview'
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
if self.get_object() == self.request.user: if self.get_object() == self.request.user:
@ -208,7 +204,7 @@ class SetUserStatusView(RedirectView, SingleObjectMixin):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
allow_ajax = True allow_ajax = True
url = 'user_overview' url_name = 'user_overview'
model = User model = User
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
@ -400,8 +396,6 @@ class GroupCreateView(CreateView):
context_object_name = 'group' context_object_name = 'group'
model = Group model = Group
form_class = GroupForm form_class = GroupForm
success_url = 'user_group_overview'
apply_url = 'user_group_edit'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
delete_default_permissions() delete_default_permissions()
@ -417,8 +411,6 @@ class GroupUpdateView(UpdateView):
model = Group model = Group
context_object_name = 'group' context_object_name = 'group'
form_class = GroupForm form_class = GroupForm
success_url = 'user_group_overview'
apply_url = 'user_group_edit'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
delete_default_permissions() delete_default_permissions()
@ -431,7 +423,7 @@ class GroupDeleteView(DeleteView):
""" """
permission_required = 'participant.can_manage_participant' permission_required = 'participant.can_manage_participant'
model = Group model = Group
url = 'user_group_overview' success_url_name = 'user_group_overview'
def pre_redirect(self, request, *args, **kwargs): def pre_redirect(self, request, *args, **kwargs):
if self.get_object().name.lower() in ['anonymous', 'registered']: if self.get_object().name.lower() in ['anonymous', 'registered']:

View File

@ -307,7 +307,7 @@ class DeleteView(SingleObjectMixin, QuestionMixin, RedirectView):
return reverse(self.success_url_name, args=self.get_url_name_args()) return reverse(self.success_url_name, args=self.get_url_name_args())
def get_url_name_args(self): def get_url_name_args(self):
return [self.poll.motion.pk] return []
def get_question(self): def get_question(self):
return _('Do you really want to delete %s?') % html_strong(self.object) return _('Do you really want to delete %s?') % html_strong(self.object)