diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

Error 500 when /reviews/add/27/ or /select-variant is called by spammers #167

Open jzuschlag opened 9 years ago

jzuschlag commented 9 years ago

Since URLconf of django_reviews matches /reviews/add/27/ I don't have a good idea to omit this error. For /select-variant (and maybe others) there might be a solution. The problem is, the spammers are producing a lot of error mails. Any ideas?

pigletto commented 9 years ago

Same thing: https://github.com/diefenbach/django-reviews/pull/1 ?

jzuschlag commented 9 years ago

Well, same thing for /reviews/add/27/. But your patch doesn't work for me (0.7.7). The exception is not found: "except ctype.model_class().DoesNotExist:" Just a simple "except:" worked for me.

/select-variant is a different case. In lfs.select-variant "variant = Product.objects.get(pk=variant_id)" is called with variant_id=None and throws a DoesNotExist exception. Shall we just look for variant_id=None and through a 404?