This commit is contained in:
koksnuss 2020-05-12 21:04:12 +02:00
parent c6abd72681
commit 60c500d219
2 changed files with 4 additions and 7 deletions

View File

@ -129,11 +129,11 @@ function render_response(data, td, set) {
if (set['found'] && set['found_by'] && set['exists']) {
div_class = set['found_by'];
$(td).find('div.coin span').html('').html('x');
/* add/update name */
if ('name' in data) {
console.log(data['name']);
let c = String(value).substring(2,3);
let div_special_name = $(td).find('div.special' + c + '_name');
console.log(div_special_name);
if (div_special_name.length == 0) {
$(td).append('<div class="special' + c + '_name three_lines">' + data['name'] + '</div>');
} else if (div_special_name.length == 1) {
@ -154,9 +154,6 @@ function render_response(data, td, set) {
/* apply div overlay styles */
$(td).find('div[type=overlay]').removeClass();
$(td).find('div[type=overlay]').addClass('found ' + div_class);
//TODO add text to Sondermünzen :))
}

View File

@ -277,7 +277,7 @@ def add_coin(request):
ec = False
else:
name = request.POST['name'] if request.POST['name'] else ''
name = request.POST.get('name', '')
try:
name = str(name)
except Exception as e:
@ -328,7 +328,7 @@ def add_coin(request):
coin.checked = checked
coin.in_collector = ec
coin.exists = exists
coin.save()
coin.save(force_update=True)
except Coin.DoesNotExist:
Coin.objects.create(