Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Aug 3, 2023
1 parent 2ecdfdc commit 2a67283
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions OpenOversight/app/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def edit_assignment(officer_id, assignment_id):
@ac_or_admin_required
def add_salary(officer_id):
form = SalaryForm()
form.created_by.data = current_user.get_id()
officer = Officer.query.filter_by(id=officer_id).first()
if not officer:
flash("Officer not found")
Expand Down Expand Up @@ -457,6 +458,7 @@ def edit_salary(officer_id, salary_id):

salary = Salary.query.filter_by(id=salary_id).one()
form = SalaryForm(obj=salary)
form.created_by.data = salary.created_by
if form.validate_on_submit():
form.populate_obj(salary)
db.session.add(salary)
Expand Down

0 comments on commit 2a67283

Please sign in to comment.