f237539 [frontend] fix Pagure-triggered Package builds

Authored and Committed by praiskup 5 years ago
    [frontend] fix Pagure-triggered Package builds
    
    There might exist multiple Packages in database (across many
    coprs) being build-triggered by the same clone_url (by the same
    pagure pull-request event).  But previously would be triggered
    only one package build, for the first Package (randomly) because
    the code expected that only one Build in whole database can
    reference the same 'scm_object_url'.
    
    The most frequent problem with this was in forked projects
    probably; project forks inherited packages with theirs SCM
    configuration.
    
    There was also bug in packages_logic.py where the old code
    expected that 'CoprDir.name' is unique across all copr projects.
    So instead of filtering by name, filter by id.
    
    Fixes: #586, PR#641