Skip to content

Commit

Permalink
Merge pull request #110 from indera/fix-email-attribute-error
Browse files Browse the repository at this point in the history
Fix email attribute error - closes #109
  • Loading branch information
indera committed Aug 26, 2015
2 parents 7356155 + 2ac953a commit c68c124
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 36 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# http://docs.travis-ci.com/user/migrating-from-legacy/
sudo: false
language: python
cache: pip
python:
- "2.7"

Expand Down
35 changes: 34 additions & 1 deletion app/fabfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
"""
The 'fabfile.py' is used by Fabric and must reside in the
application root directory.
Expand All @@ -12,6 +13,9 @@
from fabric.contrib.console import confirm
from contextlib import contextmanager

STATUS_PASS = '✔'
STATUS_FAIL = '✗'


@task
def prep_deploy():
Expand Down Expand Up @@ -92,7 +96,9 @@ def coverage():
# https://pytest.org/latest/example/pythoncollection.html
local('python setup.py nosetests')
"""
local('py.test --tb=short -s --cov redidropper --cov-config tests/.coveragerc --cov-report term-missing --cov-report html tests/')
local(
'py.test --tb=short -s --cov redidropper --cov-config tests/.coveragerc --cov-report term-missing --cov-report html tests/')


@task
def lint():
Expand All @@ -108,6 +114,33 @@ def run():
local('python run.py')


@task
def show_versions(url='https://localhost:5000'):
""" display latest tag and deployed tag at a specific url
Example: fab show_versions:url=https://stage.dropper.ctsi.ufl.edu
"""
local('git fetch --tags')

cmd = """git tag \
| sort -t. -k 1,1n -k 2,2n -k 3,3n \
| tail -1"""
last_tag = local(cmd, capture=True)

cmd2 = 'curl -sk {}'.format(url) + """ \
| grep Version \
| grep -oE "[0-9.]{1,2}[0-9.]{1,2}[0-9a-z.]{1,4}" \
| tail -1"""
deployed_tag = local(cmd2, capture=True)

print("\nLast tag: {}".format(colors.yellow(last_tag)))
print("Deployed tag: {}".format(colors.yellow(deployed_tag)))

if last_tag != deployed_tag:
print("[{}] Tags do not match!".format(colors.red(STATUS_FAIL)))
else:
print("[{}] Tags do match.".format(colors.green(STATUS_PASS)))


@contextmanager
def virtualenv(venv_name):
""" Activate a context """
Expand Down
5 changes: 3 additions & 2 deletions app/redidropper/models/log_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ def get_logs(per_page=25, page_num=1):
def item_from_entity(entity):
return {
'id': entity.id,
'user_email': entity.web_session.user.email,
'user_email': entity.web_session.user.email
if entity.web_session.user is not None else '',
'type': entity.log_type.type,
'details': entity.details,
'web_session_ip': entity.web_session.ip,
'date_time': utils.localize_est_datetime(entity.date_time),
}
}

pagination = LogEntity.query.paginate(page_num, per_page, False)
items = map(item_from_entity, pagination.items)
Expand Down
12 changes: 6 additions & 6 deletions app/redidropper/routes/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,18 @@ def logout():
https://shib.ncsu.edu/docs/logout.html
https://wiki.shibboleth.net/confluence/display/CONCEPT/SLOIssues
"""
# Log the logout
if 'uuid' in session:
LogEntity.logout(session['uuid'])

logout_user()

# Remove session keys set by Flask-Principal
for key in ('identity.name', 'identity.auth_type'):
# Remove session keys set by Flask-Principal, and `uuid` key set manually
for key in ('identity.name', 'identity.auth_type', 'uuid'):
session.pop(key, None)

# Tell Flask-Principal the user is anonymous
identity_changed.send(current_app._get_current_object(),
identity=AnonymousIdentity())

# Log the logout
LogEntity.logout(session['uuid'])
# Also pop the session id
session.pop('uuid')
return redirect('/')
69 changes: 42 additions & 27 deletions app/redidropper/static/css/parallax.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ This stylesheet and the associated (x)html may be modified in any way to fit you
}

/* additional sections */
#home {
background: url(/static/img/bottles.jpg) no-repeat center center fixed;
#home,
#image2,
#image3 {
background: no-repeat center center fixed;
display: table;
height: 45vh;
position: relative;
Expand All @@ -40,28 +42,18 @@ This stylesheet and the associated (x)html may be modified in any way to fit you
background-size: cover;
}

#home {
background-image: url(/static/img/bottles.jpg);
}

#image2 {
background: url(/static/img/oil.jpg) no-repeat center center fixed;
display: table;
height: 45vh;
position: relative;
width: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-image: url(/static/img/oil.jpg);
}

#image3 {
background: url(/static/img/red-oil-flipped.jpg) no-repeat center center fixed;
display: table;
height: 45vh;
position: relative;
width: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-image: url(/static/img/oil.jpg);
transform: scaleY(-1);
filter: FlipV;
}

#about {
Expand Down Expand Up @@ -99,15 +91,38 @@ This stylesheet and the associated (x)html may be modified in any way to fit you
color: #FFFFFF;
}

#information .container {
background: url(/static/img/translucent-oil.jpg) no-repeat center center fixed;
height: 100vh;
display: table;
position: relative;
width: 100%;
background-size: cover;

#information {
height: 100vh;
background: #fff no-repeat center center fixed;
display: table;
position: relative;
width: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

#information:before {
background-image: url(/static/img/oil.jpg);
background-repeat: no-repeat;
content: ' ';
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
opacity: 0.3;
background-position: 50% 0;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}


#stardiv {
position: relative;
top: 20vh;
Expand Down
Binary file removed app/redidropper/static/img/red-oil-flipped.jpg
Binary file not shown.
Binary file removed app/redidropper/templates/images/.DS_Store
Binary file not shown.
Binary file removed app/redidropper/templates/images/bottles.jpg
Binary file not shown.
Binary file removed app/redidropper/templates/images/bottles_sm.jpg
Binary file not shown.
Binary file removed app/redidropper/templates/images/drop-water.jpg
Binary file not shown.
Binary file not shown.
Binary file removed app/redidropper/templates/images/oil_red.jpg
Binary file not shown.
Binary file removed app/redidropper/templates/images/phone-handle.gif
Binary file not shown.
Binary file removed app/redidropper/templates/images/phone_icon.png
Binary file not shown.
Binary file removed prototype/dropper-parallax/.DS_Store
Binary file not shown.
Binary file removed prototype/dropper-parallax/images/.DS_Store
Binary file not shown.

0 comments on commit c68c124

Please sign in to comment.