Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GENERAL: Delete products #15

Closed
CHAMPION316 opened this issue Jul 13, 2022 · 1 comment
Closed

GENERAL: Delete products #15

CHAMPION316 opened this issue Jul 13, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation must have

Comments

@CHAMPION316
Copy link
Owner

CHAMPION316 commented Jul 13, 2022

As an admin I want to be able to delete products from the admin menu or from the UI itself.

@CHAMPION316
Copy link
Owner Author

CHAMPION316 commented Sep 26, 2022

Admin has administration capabilities to delete products from the website itself or by going into the admin page. The code for this file is found in products/views.py under the function
`
@login_required()
def delete_product(request, product_id):
""" Delete a product from the store """
if not request.user.is_superuser:
messages.error(request, 'Sorry, only users with special privileges can do that.')
return redirect(reverse('home'))

product = get_object_or_404(Product, pk=product_id)
product.delete()
messages.success(request, 'Product deleted')
return redirect(reverse('products'))`

@CHAMPION316 CHAMPION316 added documentation Improvements or additions to documentation must have user story labels Sep 26, 2022
@CHAMPION316 CHAMPION316 changed the title USER STORY: Delete products GENERAL: Delete products Oct 27, 2022
@CHAMPION316 CHAMPION316 self-assigned this Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation must have
Projects
None yet
Development

No branches or pull requests

1 participant