Unverified Commit 1bd4a233 authored by David Beniamine's avatar David Beniamine
Browse files

Fix double insert detection

parent 51134106
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -43,10 +43,16 @@ def add_to_handymenu(user, cmd, category):
        lastId = max(app['id'], lastId)
        if(app['name'] == category):
            for launcher in app['apps']:
                if(launcher['Exec'] == cmd['Exec']):
                if(launcher['cmd'] == cmd['cmd']):
                    alreadyIn = True
            if(not alreadyIn):
                app['apps'] += [cmd]
            else:
                print("The command '{cmd}' is already in {category} under the name : '{name}'".format(
                    cmd=cmd['cmd'],
                    category=category,
                    name=cmd['name']
                ))
            found = True

    if(not found):