Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pinoaffe authored Oct 1, 2017
2 parents ec66144 + 7776e59 commit 9f4c6ba
Show file tree
Hide file tree
Showing 32 changed files with 514 additions and 332 deletions.
10 changes: 5 additions & 5 deletions gratipay/homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def _parse(raw):
email_address = email_address[:255]
errors.append('email_address')

follow_up = x('follow_up')
if follow_up not in ('quarterly', 'yearly', 'never'):
follow_up = 'quarterly'
errors.append('follow_up')
on_mailing_list = x('on_mailing_list')
if on_mailing_list not in ('yes', 'no'):
on_mailing_list = 'yes'
errors.append('on_mailing_list')

# promo fields
promotion_name = x('promotion_name')
Expand Down Expand Up @@ -78,7 +78,7 @@ def _parse(raw):
, 'grateful_for': grateful_for
, 'name': name
, 'email_address': email_address
, 'follow_up': follow_up
, 'on_mailing_list': on_mailing_list
, 'promotion_name': promotion_name
, 'promotion_url': promotion_url
, 'promotion_twitter': promotion_twitter
Expand Down
2 changes: 1 addition & 1 deletion gratipay/models/participant/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_email_verification_link(self, c, email, *packages):
nonce = self.get_email_verification_nonce(c, email)
if packages:
self.start_package_claims(c, nonce, *packages)
link = "{base_url}/~{username}/emails/verify.html?email2={encoded_email}&nonce={nonce}"
link = "{base_url}/~{username}/emails/verify.html?email={encoded_email}&nonce={nonce}"
return link.format( base_url=gratipay.base_url
, username=self.username_lower
, encoded_email=encode_for_querystring(email)
Expand Down
7 changes: 4 additions & 3 deletions gratipay/models/payment_for_open_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ def from_uuid(cls, uuid, cursor=None):


@classmethod
def insert(cls, amount, grateful_for, name, follow_up, email_address,
def insert(cls, amount, grateful_for, name, on_mailing_list, email_address,
promotion_name, promotion_url, promotion_twitter, promotion_message,
cursor=None):
"""Take baseline info and insert into the database.
"""
uuid = uuid4().hex
on_mailing_list = on_mailing_list == 'yes'
return (cursor or cls.db).one("""
INSERT INTO payments_for_open_source
(uuid, amount, grateful_for, name, follow_up, email_address,
(uuid, amount, grateful_for, name, on_mailing_list, email_address,
promotion_name, promotion_url, promotion_twitter, promotion_message)
VALUES (%s, %s, %s, %s, %s, %s,
%s, %s, %s, %s)
RETURNING payments_for_open_source.*::payments_for_open_source
""", (uuid, amount, grateful_for, name, follow_up, email_address,
""", (uuid, amount, grateful_for, name, on_mailing_list, email_address,
promotion_name, promotion_url, promotion_twitter, promotion_message))


Expand Down
25 changes: 23 additions & 2 deletions gratipay/project_review_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from gratipay.models.participant import Participant


SHIELD = "[![Gratipay](https://img.shields.io/gratipay/project/{}.svg)](https://gratipay.com{})"


class ProjectReviewProcess(object):

def __init__(self, env, db, email_queue):
Expand Down Expand Up @@ -43,15 +46,33 @@ def start(self, *teams):
else:
title = "{} and {} other projects".format(teams[0].name, nteams-1)

body = []
body = [ '*This application will remain open for at least a week.*'
, ''
, '## Project' + ('s' if nteams > 1 else '')
, ''
]
team_ids = []
owner_usernames = set()
for team in teams:
team_ids.append(team.id)
owner_usernames.add(team.owner)
body.append('https://gratipay.com{}'.format(team.url_path))
assert len(owner_usernames) == 1, owner_usernames
body.extend(['', '(This application will remain open for at least a week.)'])

shield = SHIELD.format(teams[0].slug, teams[0].url_path)
# let them discover how to adapt for additional projects
body += [ ''
, '## Badge'
, ''
, 'Add a [badge](http://shields.io/) to your README?'
, ''
, shield
, ''
, '```markdown'
, shield
, '```'
]

data = json.dumps({'title': title, 'body': '\n'.join(body)})
review_url = self._poster.post(data)

Expand Down
4 changes: 4 additions & 0 deletions gratipay/security/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def add_headers_to_response(website, response):
if 'X-Content-Type-Options' not in response.headers:
response.headers['X-Content-Type-Options'] = 'nosniff'

# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
if 'strict-transport-security' not in response.headers:
response.headers['strict-transport-security'] = 'max-age=31536000'

# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
if 'X-XSS-Protection' not in response.headers:
response.headers['X-XSS-Protection'] = '1; mode=block'
Expand Down
2 changes: 1 addition & 1 deletion gratipay/testing/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def make_payment_for_open_source(self, **info):
, grateful_for='open source!'
, name='Alice Liddell'
, email_address='[email protected]'
, follow_up='quarterly'
, on_mailing_list=True
, promotion_name='Wonderland'
, promotion_url='http://www.example.com/'
, promotion_twitter='thebestbutter'
Expand Down
71 changes: 37 additions & 34 deletions i18n/core/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ msgstr ""
msgid "Eep! Mind looking over your info for us?"
msgstr ""

msgid "Pay for open source."
msgstr "Für Open Source bezahlen."
msgid "Invest in open source."
msgstr ""

msgid "Payment complete!"
msgstr ""
Expand All @@ -750,7 +750,7 @@ msgstr ""
msgid "We weren't able to process your card."
msgstr ""

msgid "Thank you for paying for open source!"
msgid "Thank you for investing in open source!"
msgstr ""

msgid "Email {support}{br}with questions or feedback."
Expand All @@ -773,20 +773,26 @@ msgstr[0] ""
msgstr[1] ""

msgid ""
"Open source boosts the productivity of your developers {a}by 20%{_a}. "
"Companies fund half of open source through developer time."
"From {varnish} to {vuejs}, {drf} to {django} itself, {ruby} to {webpack}, "
"there are more and more examples of community-led open source projects "
"funded by enlightened companies."
msgstr ""

msgid ""
"Gratipay is the easiest way to pay for {a}the other half{_a}. Pay for open "
"source, and {b}strengthen the foundation{_b} that your developers build on. "
"Increase innovation and {b}reduce risk{_b} for your company."
"Inspired by this trend, #BackTheStack is a {b} funding campaign for the "
"whole open source community{_b}. If we all band together, can we encourage "
"even more of the industry to participate? Can we sustain even more of the "
"ecosystem, including parts that are less flashy?"
msgstr ""

msgid ""
"Gratipay can {b}report back{_b} to you on the progress your payment enables,"
" and we can {b}promote{_b} your contribution, increasing your visibility "
"within the open source community."
"Your company's ROI on #BackTheStack will be {b}at least 10x{_b}. Pay $10,000"
" for $100,000 in maintenance and new development. We'll report back on the "
"impact of this shared investment, and we'd be thrilled to promote your "
"company's contribution to it."
msgstr ""

msgid "Join #BackTheStack and invest in open source today!"
msgstr ""

msgid "Optional"
Expand Down Expand Up @@ -822,22 +828,19 @@ msgstr ""
msgid "You will get a link to an invoice for your payment."
msgstr ""

msgid "Follow-up"
msgstr ""

msgid "Quarterly"
msgid "Join Mailing List"
msgstr ""

msgid "Yearly"
msgstr ""
msgid "Yes"
msgstr "Ja"

msgid "Never"
msgstr ""
msgid "No"
msgstr "Nein"

msgid "I am surprised that you are seeing this message."
msgstr ""

msgid "You will get a progress report, with a reminder to pay again."
msgid "We send updates related to #BackTheStack."
msgstr ""

msgid "Promotion"
Expand Down Expand Up @@ -873,7 +876,7 @@ msgstr ""
msgid "Submit Form"
msgstr ""

msgid "Pay for Open Source"
msgid "Invest in Open Source"
msgstr ""

msgid "Processing ..."
Expand Down Expand Up @@ -1007,12 +1010,6 @@ msgstr "Hinzufügen"
msgid "Are you sure?"
msgstr "Sind Sie sicher?"

msgid "Yes"
msgstr "Ja"

msgid "No"
msgstr "Nein"

msgid "Already closed."
msgstr "Bereits geschlossen."

Expand Down Expand Up @@ -1270,21 +1267,30 @@ msgstr ""
msgid "Linked to a different account"
msgstr ""

msgid "Ready to use"
msgstr ""

msgid "Your primary email address"
msgstr ""

msgid "Linked to your account"
msgstr ""

msgid "Half-linked to your account"
msgid "Verification pending"
msgstr ""

msgid "Unverified"
msgstr "Unverifiziert"

msgid "Apply to accept payments"
msgstr ""

msgid "Resend verification"
msgstr ""

msgid "Verify email address"
msgstr ""

msgid "Dead-end, sorry"
msgstr ""

msgid "Addresses are from {a}{code}maintainers{_code}{_a}."
msgstr ""

Expand Down Expand Up @@ -1615,9 +1621,6 @@ msgstr "Identitäten"
msgid "Verified"
msgstr "Verifiziert"

msgid "Unverified"
msgstr "Unverifiziert"

msgid "Add Identity"
msgstr "Identität Hinzufügen"

Expand Down
Loading

0 comments on commit 9f4c6ba

Please sign in to comment.