Skip to content

Commit

Permalink
[fix] PEP-8 and Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Oct 23, 2019
1 parent 8e78c1d commit d9ce6c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bothub/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def token_generator(self):
return PasswordResetTokenGenerator()

def send_welcome_email(self):
if not settings.SEND_EMAILS
if not settings.SEND_EMAILS:
return False # pragma: no cover
context = {"name": self.name, "base_url": settings.BASE_URL}
send_mail(
Expand All @@ -113,7 +113,7 @@ def send_reset_password_email(self):
reset_url = "{}reset-password/{}/{}/".format(
settings.BOTHUB_WEBAPP_BASE_URL, self.nickname, token
)
context = {"reset_url": reset_url, 'base_url': settings.BASE_URL}
context = {"reset_url": reset_url, "base_url": settings.BASE_URL}
send_mail(
_("Reset your bothub password"),
render_to_string("authentication/emails/reset_password.txt", context),
Expand Down
5 changes: 4 additions & 1 deletion bothub/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,10 @@ def send_new_request_email_to_admins(self):
def send_request_rejected_email(self):
if not settings.SEND_EMAILS:
return False # pragma: no cover
context = {"repository_name": self.repository.name, "base_url": settings.BASE_URL}
context = {
"repository_name": self.repository.name,
"base_url": settings.BASE_URL,
}
send_mail(
_("Access denied to {}").format(self.repository.name),
render_to_string("common/emails/request_rejected.txt", context),
Expand Down
3 changes: 2 additions & 1 deletion bothub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
BOTHUB_ENGINE_AWS_S3_BUCKET_NAME=(str, ""),
BOTHUB_ENGINE_AWS_REGION_NAME=(str, "us-east-1"),
BOTHUB_ENGINE_AWS_SEND=(bool, False),
BASE_URL=(str, "http://api.bothub.it/"),
)

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
Expand All @@ -59,7 +60,7 @@

ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")

BASE_URL = config('BASE_URL', default='')
BASE_URL = env.str("BASE_URL")

# Application definition

Expand Down
4 changes: 3 additions & 1 deletion bothub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def wrapper(request):
path(
"welcome/",
render_template(
"authentication/emails/welcome.html", name="User", base_url=settings.BASE_URL
"authentication/emails/welcome.html",
name="User",
base_url=settings.BASE_URL,
),
),
path(
Expand Down

0 comments on commit d9ce6c8

Please sign in to comment.