Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added full name to emergency contact updates as well as insurance updates in admin logs (Updated) | Eun Sung & Mustafa #1285

Merged
merged 2 commits into from
Jul 24, 2024
Merged
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
9 changes: 6 additions & 3 deletions app/controllers/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def emergencyContactInfo(username):
if not (g.current_user.username == username or g.current_user.isCeltsAdmin):
abort(403)


user = User.get(User.username == username)

if request.method == 'GET':
readOnly = g.current_user.username != username
contactInfo = EmergencyContact.get_or_none(EmergencyContact.user_id == username)
Expand All @@ -227,7 +228,7 @@ def emergencyContactInfo(username):
rowsUpdated = EmergencyContact.update(**request.form).where(EmergencyContact.user == username).execute()
if not rowsUpdated:
EmergencyContact.create(user = username, **request.form)
createActivityLog(f"{g.current_user} updated {username}'s emergency contact information.")
createActivityLog(f"{g.current_user.fullName} updated {user.fullName}'s emergency contact information.")
flash('Emergency contact information saved successfully!', 'success')

if request.args.get('action') == 'exit':
Expand All @@ -242,6 +243,8 @@ def insuranceInfo(username):
"""
if not (g.current_user.username == username or g.current_user.isCeltsAdmin):
abort(403)

user = User.get(User.username == username)

if request.method == 'GET':
readOnly = g.current_user.username != username
Expand All @@ -260,7 +263,7 @@ def insuranceInfo(username):
rowsUpdated = InsuranceInfo.update(**request.form).where(InsuranceInfo.user == username).execute()
if not rowsUpdated:
InsuranceInfo.create(user = username, **request.form)
createActivityLog(f"{g.current_user} updated {username}'s emergency contact information.")
createActivityLog(f"{g.current_user.fullName} updated {user.fullName}'s insurance information.")
flash('Insurance information saved successfully!', 'success')

if request.args.get('action') == 'exit':
Expand Down
Loading