Commit 91a55d26 authored by Olivier Cornu's avatar Olivier Cornu
Browse files

un Exercice sans description est ignoré.

parent 3d56c561
......@@ -9,10 +9,6 @@ levels = {}
class Exercise(object):
''' Base class for all exercise types. '''
description = u'Description'
level = u'Academic level'
thumb = 'path/to/thumbnail.png'
def __str__(self):
return self.description
......@@ -73,7 +69,7 @@ def __islegacy(obj):
def __isexercise(obj):
''' Is target object an exercise (in new format)? '''
return inspect.isclass(obj) and issubclass(obj, Exercise)
return inspect.isclass(obj) and issubclass(obj, Exercise) and __hasdescription(obj)
def __level(level):
''' Format academic level(s). '''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment