privacyidea / privacyidea
Showing 1 of 1 files from the diff.

@@ -38,6 +38,7 @@
Loading
38 38
import binascii
39 39
import six
40 40
import logging
41 +
import traceback
41 42
from datetime import datetime, timedelta
42 43
43 44
from dateutil.tz import tzutc
@@ -53,7 +54,7 @@
Loading
53 54
from sqlalchemy import and_
54 55
from sqlalchemy.schema import Sequence
55 56
from sqlalchemy.ext.compiler import compiles
56 -
from sqlalchemy.sql.expression import ColumnElement
57 +
from sqlalchemy.exc import IntegrityError
57 58
from .lib.log import log_with
58 59
from privacyidea.lib.utils import (is_true, convert_column_to_unicode,
59 60
                                   hexlify_and_unicode)
@@ -2609,7 +2610,11 @@
Loading
2609 2610
            if self.hostname is not None:
2610 2611
                values["hostname"] = self.hostname
2611 2612
            ClientApplication.query.filter(ClientApplication.id == clientapp.id).update(values)
2612 -
        db.session.commit()
2613 +
        try:
2614 +
            db.session.commit()
2615 +
        except IntegrityError as e:  # pragma: no cover
2616 +
            log.info('Unable to write ClientApplication entry to db: {0!s}'.format(e))
2617 +
            log.debug(traceback.format_exc())
2613 2618
2614 2619
    def __repr__(self):
2615 2620
        return "<ClientApplication [{0!s}][{1!s}:{2!s}] on {3!s}>".format(
Files Coverage
privacyidea 95.83%
Project Totals (166 files) 95.83%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading