Skip to content

Commit

Permalink
Merge pull request #236 from CUCWD/feature.maple/organization-institu…
Browse files Browse the repository at this point in the history
…tions

Prevent page from crashing when `OrganizationInstitution` is not assigned to a course.
  • Loading branch information
ztraboo authored Sep 11, 2024
2 parents 5dfd066 + efc5980 commit 007555d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions lms/templates/dashboard/_dashboard_program_surveys.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,24 @@
username_string = "platform_username=" + (user.username or "")
platform_fullname = "platform_fullname=" + (user.profile.name or "")
user_email_string = "platform_email=" + (user.email or "")
org_institution_name_string = "org_institution_name=" + (course_institution.name or "")
org_institution_shortname_string = "org_institution_short_name=" + (course_institution.short_name or "")
org_institution_city_string = "org_institution_city=" + (course_institution.city or "")
org_institution_state_string = "org_institution_state=" + (course_institution.state or "")
org_institution_zipcode_string = "org_institution_zipcode=" + (course_institution.zipcode or "")

org_institution_name_string = "org_institution_name="
org_institution_shortname_string = "org_institution_short_name="
org_institution_city_string = "org_institution_city="
org_institution_state_string = "org_institution_state="
org_institution_zipcode_string = "org_institution_zipcode="
if course_institution is not None:
org_institution_name_string += (course_institution.name or "")
org_institution_shortname_string += (course_institution.short_name or "")
org_institution_city_string += (course_institution.city or "")
org_institution_state_string += (course_institution.state or "")
org_institution_zipcode_string += (course_institution.zipcode or "")

try:
demographic_zipcode = "demographic_zipcode=" + (ExtraInfo.objects.get(user_id=user.id).zipcode or "")
except:
demographic_zipcode = "demographic_zipcode="

demographic_country = "demographic_country=" + (str(user.profile.country) or "")
program_name = "program_name=" + "Aviation Mechanic General"
%>
Expand All @@ -66,7 +75,7 @@ <h2 class="survey-title">Pre-Program Survey</h2>
<hr>
<p class="survey-instructions">Answer this survey prior to taking any course content</p>
<p class="survey-details">This will help us understand your career awareness and interest, gauge where you are with FAA General maintenance knowledge and skill confidence, career plans, and demographic information.</p>
<a class="provide-feedback-btn" href="https://clemson.qualtrics.com/jfe/form/SV_3C2RY5TuB0uIZ70?${username_string}&${platform_fullname}&${user_email_string}&${platform_anonymous_user_id_string}&${org_institution_name_string}&${org_institution_shortname_string}&${org_institution_city_string}&${org_institution_state_string}&${org_institution_zipcode_string}&${demographic_zipcode}&${demographic_country}&${program_name}">
<a class="provide-feedback-btn" href="https://clemson.qualtrics.com/jfe/form/SV_3C2RY5TuB0uIZ70?${username_string}&${platform_fullname}&${user_email_string}&${platform_anonymous_user_id_string}&${org_institution_name_string}&${org_institution_shortname_string}&${org_institution_city_string}&${org_institution_state_string}&${org_institution_zipcode_string}&${demographic_zipcode}&${demographic_country}&${program_name}" target="_blank">
Provide Feedback</a>
</div>

Expand All @@ -75,7 +84,7 @@ <h2 class="survey-title">Post-Program Survey</h2>
<hr>
<p class="survey-instructions">Answer this survey after you have completed most of this program's courses</p>
<p class="survey-details">This will help us understand your completion of FAA General maintenance program, career awareness and interest, kwowledge and skill confidence, and demographic information.</p>
<a class="provide-feedback-btn" href="https://clemson.qualtrics.com/jfe/form/SV_1Al5SpJgWVv6bFI?${username_string}&${platform_fullname}&${user_email_string}&${platform_anonymous_user_id_string}&${org_institution_name_string}&${org_institution_shortname_string}&${org_institution_city_string}&${org_institution_state_string}&${org_institution_zipcode_string}&${demographic_zipcode}&${demographic_country}&${program_name}">
<a class="provide-feedback-btn" href="https://clemson.qualtrics.com/jfe/form/SV_1Al5SpJgWVv6bFI?${username_string}&${platform_fullname}&${user_email_string}&${platform_anonymous_user_id_string}&${org_institution_name_string}&${org_institution_shortname_string}&${org_institution_city_string}&${org_institution_state_string}&${org_institution_zipcode_string}&${demographic_zipcode}&${demographic_country}&${program_name}" target="_blank">
Provide Feedback</a>
</div>
</div>
Expand Down

0 comments on commit 007555d

Please sign in to comment.