Change DeviceEnvironment from custom model to CI.
Fix flake8 errors
Merge pull request #1037 from quamilek/environment_as_ci

Change DeviceEnvironment from custom model to CI.
Moving CITypes ids.
Change sql syntax for sqlite3
Merge pull request #1044 from quamilek/synergy-move_ci_type_ids

Moving CITypes ids.
Merge branch 'synergy' into synergy-scrooge