Small style changes.

This commit is contained in:
Norman Jäckel 2016-09-22 21:43:49 +02:00 committed by Norman Jäckel
parent 970f42cacb
commit 926516ac65
3 changed files with 7 additions and 9 deletions

View File

@ -9,7 +9,6 @@ def convert_duration(apps, schema_editor):
Item = apps.get_model('agenda', 'item') Item = apps.get_model('agenda', 'item')
for item in Item.objects.all(): for item in Item.objects.all():
duration = item.duration duration = item.duration
item.duration_tmp = None item.duration_tmp = None
if is_int(duration): if is_int(duration):
# assuming that these are minutes # assuming that these are minutes
@ -26,9 +25,10 @@ def convert_duration(apps, schema_editor):
def is_int(s): def is_int(s):
try: try:
int(s) int(s)
return True
except ValueError: except ValueError:
return False return False
else:
return True
class Migration(migrations.Migration): class Migration(migrations.Migration):

View File

@ -433,10 +433,8 @@ angular.module('OpenSlidesApp.core', [
.filter('osMinutesToTime', [ .filter('osMinutesToTime', [
function () { function () {
return function (totalminutes) { return function (totalminutes) {
if (!totalminutes) { var time = '';
return ''; if (totalminutes) {
} else {
var time = "";
if (totalminutes < 0) { if (totalminutes < 0) {
time = "-"; time = "-";
totalminutes = -totalminutes; totalminutes = -totalminutes;
@ -446,8 +444,8 @@ angular.module('OpenSlidesApp.core', [
// Add leading "0" for double digit values // Add leading "0" for double digit values
mm = ("0" + mm).slice(-2); mm = ("0" + mm).slice(-2);
time += hh + ":" + mm; time += hh + ":" + mm;
return time;
} }
return time;
}; };
} }
]) ])