Esempio n. 1
0
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     if self.cleaned_data['cat']:
         return TARAKO_CATEGORIES_MAPPING.get(self.cleaned_data['cat'],
                                              [self.cleaned_data['cat']])
     return None
Esempio n. 2
0
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     if self.cleaned_data['cat']:
         return TARAKO_CATEGORIES_MAPPING.get(self.cleaned_data['cat'],
                                              [self.cleaned_data['cat']])
     return None
Esempio n. 3
0
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     cat = self.cleaned_data['cat']
     if cat.startswith('tarako'):
         return TARAKO_CATEGORIES_MAPPING.get(cat, [cat])
     if cat in CATEGORY_REDIRECTS:
         return [CATEGORY_REDIRECTS[cat]]
     if cat:
         return [cat]
Esempio n. 4
0
 def clean_cat(self):
     # If request category is a tarako one, get the corresponding list of
     # slugs, otherwise just build a list with the slug requested.
     cat = self.cleaned_data['cat']
     if cat.startswith('tarako'):
         return TARAKO_CATEGORIES_MAPPING.get(cat, [cat])
     if cat in CATEGORY_REDIRECTS:
         return [CATEGORY_REDIRECTS[cat]]
     if cat:
         return [cat]