#773 create/edit notification checks for duplicity
Merged by mikem. Opened by tkopecek.
tkopecek/koji issue687  into  master

Download 773.patch

createNotification and updateNotification allows to have more
notification on same event/e-mail. This doesn't make much sense, so add
limitations to have only one combination.

As postgresql ignore NULL values in constraints, it is done on
application-level.

Related: https://pagure.io/koji/issue/687

rebased onto 1a60ac338ac3b5f2bae897d89d55af92a3fdb403

The email variable is not defined in the first call. We should leave it out of the check (in both calls) anyway.

When we sanitize these inputs, we should pass strict=True to the relevant lookup calls when available.

I'd rather avoid continuing lines with backslash when possible, as pep8 suggests. Long if clauses can be wrapped in parentheses, which makes continuation implicit.

Also, if we're going to touch this code, we should probably add a basic unit test and convert the sql bits to use the relevant processors.

1 new commit added

  • tests for notifications

Commit 96a52c28 fixes this pull-request

Pull-Request has been merged by mikem

Metadata