Skip to content

Commit

Permalink
Merge pull request #81 from ecds/feature/export-download-background
Browse files Browse the repository at this point in the history
send email to user after jekyll export to github
  • Loading branch information
jayvarner committed Feb 11, 2020
2 parents 0544eb9 + 9b28803 commit 6cfe0e8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: python
python:
- '3.5'
- '3.6'
- 3.6-dev
- '3.7'
- 3.7-dev
services: postgresql
before_install:
- export DATABASE_URL=postgres://postgres@localhost:5432/travisci
Expand Down
2 changes: 0 additions & 2 deletions apps/iiif/manifests/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ def update_gitrepo(self):

def github_export(self, user_email):
logger.debug('Background export started.')
user_email="benwbrum@gmail.com" #TODO !
user_has_github = False
if not self.user == None:
# check if user has a github account linked
Expand Down Expand Up @@ -575,7 +574,6 @@ def github_export(self, user_email):

email_contents = get_template('jekyll_export_email.html').render(context)
text_contents = get_template('jekyll_export_email.txt').render(context)

send_mail(
'Your Readux site export is ready!',
text_contents,
Expand Down
2 changes: 1 addition & 1 deletion apps/iiif/manifests/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def github_export_task(manifest_pid, version, github_repo=None, user_email=None,
manifest = Manifest.objects.get(pid=manifest_pid)
user = User.objects.get(id=user_id)
jekyll_exporter = JekyllSiteExport(manifest, version, github_repo=github_repo, deep_zoom=deep_zoom, owners=owner_ids, user=user);
jekyll_exporter.github_export(user_email)
jekyll_exporter.github_export(user.email)
logger.info('Background github export finished.')

@background(schedule=1)
Expand Down

0 comments on commit 6cfe0e8

Please sign in to comment.