Fix erreur 500 (catégories cassées)
This commit is contained in:
		@@ -130,13 +130,18 @@ class EventFilter(django_filters.FilterSet):
 | 
			
		||||
            if len(params['category']) == 0:
 | 
			
		||||
                return url
 | 
			
		||||
            else:
 | 
			
		||||
                category = Category.objects.filter(pk=params['category'][0]).first()
 | 
			
		||||
                cat_id = params['category'][0]
 | 
			
		||||
                del params["category"]
 | 
			
		||||
                url = parsed_url._replace(query=urlencode(params, doseq=True)).geturl()
 | 
			
		||||
                if category is None:
 | 
			
		||||
                    return url
 | 
			
		||||
                if cat_id.isdigit():
 | 
			
		||||
                    category = Category.objects.filter(pk=cat_id).first()
 | 
			
		||||
                    if category is None:
 | 
			
		||||
                        return url
 | 
			
		||||
                    else:
 | 
			
		||||
                        return "/cat:" + category.slug + url
 | 
			
		||||
                else:
 | 
			
		||||
                    return "/cat:" + category.slug + url
 | 
			
		||||
                    return url
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def filter_recurrences(self, queryset, name, value):
 | 
			
		||||
        # construct the full lookup expression
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user