Skip to content

Commit be1b130

Browse files
authored
Merge pull request #536 from mangalap123/develop
Fix Subscribe Changes Form -- Updated to Cred File
2 parents 327101b + 8e1665e commit be1b130

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

habitat/hooks/run

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22
export HOME="/hab/svc/chime/config"
3+
# export the parameters file path
4+
export PARAMETERS="${pkg_prefix}/defaults/webapp.cfg"
35
cd "/hab/svc/chime"
46

57
if [ "$(whoami)" = "root" ]; then

habitat/plan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ do_build() {
6767

6868
do_install() {
6969
cp -pr ${PLAN_CONTEXT}/../src/* "${pkg_prefix}/"
70+
cp -pr ${PLAN_CONTEXT}/../deafults/webapp.cfg "${pkg_prefix}/defaults/"
7071
return $?
7172
}
7273

src/penn_chime/view/spreadsheet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def __init__(self, st_obj, secret):
77
# use creds to create a client to interact with the Google Drive API
88
self.scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
99
#secret = 'client_secret.json'
10-
self.creds = ServiceAccountCredentials.from_json(secret)
11-
#self.creds = ServiceAccountCredentials.from_json_keyfile_name(secret, self.scope)
10+
#self.creds = ServiceAccountCredentials.from_json_keyfile_dict(secret)
11+
self.creds = ServiceAccountCredentials.from_json_keyfile_name(secret, self.scope)
1212
self.client = gspread.authorize(self.creds)
1313

1414

src/penn_chime/view/st_display.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,15 @@ def subscribe(st_obj):
444444
affiliation = st_obj.text_input (label="Enter Affiliation", value="", key="na_upper_2")
445445
if st_obj.button (label="Submit", key="ta_submit_1"):
446446
row = [email, name, affiliation]
447-
send_subscription_to_google_sheet(st_obj, row)
447+
send_subscription_to_google_sheet_secret_json(st_obj, row)
448448

449-
def send_subscription_to_google_sheet(st_obj, row):
449+
def send_subscription_to_google_sheet_secret_json(st_obj, row):
450+
json_secret = "/mnt/google-api-creds/client_secret.json"
451+
#print(json_secret)
452+
spr = spreadsheet (st_obj, json_secret)
453+
spr.writeToSheet("CHIME Form Submissions", row)
454+
455+
def send_subscription_to_google_sheet_secret_dict(st_obj, row):
450456
json_secret = readGoogleApiSecretsDict()
451457
#print(json_secret)
452458
spr = spreadsheet(st_obj, json_secret)

0 commit comments

Comments
 (0)