mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
views.py: Added validation in recipe detail
Added the validation for the maintainer in the recipe detail view. Also added a check if the recipe exists. [YOCTO #7904] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
ad5cfbed01
commit
887737027c
12
rrs/views.py
12
rrs/views.py
|
@ -325,6 +325,8 @@ class RecipeDetailView(DetailView):
|
|||
def get_context_data(self, **kwargs):
|
||||
context = super(RecipeDetailView, self).get_context_data(**kwargs)
|
||||
recipe = self.get_object()
|
||||
if not recipe:
|
||||
raise django.http.Http404
|
||||
|
||||
release = Release.get_current()
|
||||
context['release_name'] = release.name
|
||||
|
@ -353,10 +355,12 @@ class RecipeDetailView(DetailView):
|
|||
|
||||
self.recipe_maintainer_history = RecipeMaintainerHistory.get_last()
|
||||
recipe_maintainer = RecipeMaintainer.objects.filter(recipe = recipe,
|
||||
history = self.recipe_maintainer_history)[0]
|
||||
maintainer = recipe_maintainer.maintainer
|
||||
|
||||
context['maintainer_name'] = maintainer.name
|
||||
history = self.recipe_maintainer_history)
|
||||
if recipe_maintainer:
|
||||
maintainer = recipe_maintainer[0].maintainer
|
||||
context['maintainer_name'] = maintainer.name
|
||||
else:
|
||||
context['maintainer_name'] = 'No maintainer'
|
||||
|
||||
context['recipe_upgrade_details'] = []
|
||||
for ru in RecipeUpgrade.objects.filter(recipe =
|
||||
|
|
Loading…
Reference in New Issue
Block a user