Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions OpenOversight/app/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def __init__(self):
self.NUM_OFFICERS = 120
self.RATELIMIT_ENABLED = False
self.SQLALCHEMY_DATABASE_URI = "sqlite:///:memory:"
# Disable sqlite cached statements
# https://github.com/python/cpython/issues/118172
self.SQLALCHEMY_ENGINE_OPTIONS = {
"connect_args": {"cached_statements": 0},
}


class ProductionConfig(BaseConfig):
Expand Down
18 changes: 7 additions & 11 deletions OpenOversight/app/templates/submit_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,15 @@ <h3>High Security Submissions</h3>
<script src="{{ url_for('static', filename='js/dropzone.js') }}"></script>
<script src="{{ url_for('static', filename='js/init-dropzone.js') }}"></script>
<script>
// Select user's preferred department by default
document.getElementById("department").selectedIndex = {{ preferred_dept_id }} - 1;
// Save the preferred department in dept_id
let dept_id = document.getElementById("department").selectedIndex + 1;
const csrf_token = "{{ csrf_token() }}";

// Store changes in drop down list in dept_id variable
$(function() {
const select_dept = $('#dept-select');
select_dept.on('change', function() {
// fires when department selection changes
dept_id = document.getElementById("department").value;
});
// Select user's preferred department by default
let dept_id = {{ preferred_dept_id }};
$("#department").val(dept_id);

// Store drop down list changes in dept_id variable
$("#dept-select").on('change', function() {
dept_id = $("#department").val();
});

const getURL = (file) => "/upload/department/" + dept_id;
Expand Down