Преглед на файлове

fixup! Only return active ConsumptionTypes in API

Maarten van den Berg преди 5 години
родител
ревизия
eb5b135b5a
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      piket_server/__init__.py

+ 1 - 1
piket_server/__init__.py

378
 @app.route("/consumption_types", methods=["GET"])
378
 @app.route("/consumption_types", methods=["GET"])
379
 def get_consumption_types():
379
 def get_consumption_types():
380
     """ Return a list of currently active consumption types. """
380
     """ Return a list of currently active consumption types. """
381
-    ctypes = ConsumptionType.query.all().filter_by(active=True)
381
+    ctypes = ConsumptionType.query.filter_by(active=True).all()
382
     result = [ct.as_dict for ct in ctypes]
382
     result = [ct.as_dict for ct in ctypes]
383
     return jsonify(consumption_types=result)
383
     return jsonify(consumption_types=result)
384
 
384