Improve and fix user accounts

This commit is contained in:
Skia
2016-08-18 21:06:10 +02:00
parent 05bd177a9d
commit b69c3a6792
7 changed files with 73 additions and 9 deletions

View File

@ -410,3 +410,26 @@ class ProductEditView(CanEditPropMixin, UpdateView):
template_name = 'core/edit.jinja'
# TODO: add management of the 'counters' ForeignKey
class RefillingDeleteView(CanEditPropMixin, DeleteView):
"""
Delete a refilling (for the admins)
"""
model = Refilling
pk_url_kwarg = "refilling_id"
template_name = 'core/delete_confirm.jinja'
def get_success_url(self):
return reverse_lazy('core:user_account', kwargs={'user_id': self.object.customer.user.id})
class SellingDeleteView(CanEditPropMixin, DeleteView):
"""
Delete a selling (for the admins)
"""
model = Selling
pk_url_kwarg = "selling_id"
template_name = 'core/delete_confirm.jinja'
def get_success_url(self):
return reverse_lazy('core:user_account', kwargs={'user_id': self.object.customer.user.id})