Skip to content

Commit

Permalink
pre-commit linting
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Oct 28, 2018
1 parent 2d20a10 commit 08a97bd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 14 deletions.
13 changes: 10 additions & 3 deletions readthedocs/core/views/__init__.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-

"""
Core views, including the main homepage,
Expand Down Expand Up @@ -50,7 +51,11 @@ def get_context_data(self, **kwargs):
if not support_email:
support_email = 'support@{domain}'.format(
domain=getattr(
settings, 'PRODUCTION_DOMAIN', 'readthedocs.org'))
settings,
'PRODUCTION_DOMAIN',
'readthedocs.org',
),
)

context['support_email'] = support_email
return context
Expand Down Expand Up @@ -89,8 +94,10 @@ def wipe_version(request, project_slug, version_slug):
broadcast(type='build', task=remove_dir, args=[del_dir])
return redirect('project_version_list', project_slug)
return render(
request, 'wipe_version.html',
{'version': version, 'project': version.project})
request,
'wipe_version.html',
{'version': version, 'project': version.project},
)


def server_error_500(request, template_name='500.html'):
Expand Down
34 changes: 26 additions & 8 deletions readthedocs/gold/models.py
@@ -1,6 +1,13 @@
# -*- coding: utf-8 -*-

"""Django models for recurring donations aka Gold Membership."""
from __future__ import absolute_import
from __future__ import division
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)

import math

from django.db import models
Expand All @@ -9,7 +16,6 @@

from readthedocs.projects.models import Project


#: The membership options that are currently available
LEVEL_CHOICES = (
('v1-org-5', '$5/mo'),
Expand All @@ -32,11 +38,23 @@ class GoldUser(models.Model):
pub_date = models.DateTimeField(_('Publication date'), auto_now_add=True)
modified_date = models.DateTimeField(_('Modified date'), auto_now=True)

user = models.ForeignKey('auth.User', verbose_name=_('User'), unique=True, related_name='gold')
level = models.CharField(_('Level'), max_length=20,
choices=LEVEL_CHOICES, default=LEVEL_CHOICES[0][0])
projects = models.ManyToManyField(Project, verbose_name=_('Projects'),
related_name='gold_owners')
user = models.ForeignKey(
'auth.User',
verbose_name=_('User'),
unique=True,
related_name='gold',
)
level = models.CharField(
_('Level'),
max_length=20,
choices=LEVEL_CHOICES,
default=LEVEL_CHOICES[0][0],
)
projects = models.ManyToManyField(
Project,
verbose_name=_('Projects'),
related_name='gold_owners',
)

last_4_card_digits = models.CharField(max_length=4)
stripe_id = models.CharField(max_length=255)
Expand Down
13 changes: 10 additions & 3 deletions readthedocs/integrations/models.py
@@ -1,16 +1,23 @@
# -*- coding: utf-8 -*-

"""Integration models for external services."""

from __future__ import (
absolute_import, division, print_function, unicode_literals)
absolute_import,
division,
print_function,
unicode_literals,
)

import json
import re
import uuid
from builtins import object, str

from builtins import object, str
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation)
GenericForeignKey,
GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models, transaction
from django.utils.encoding import python_2_unicode_compatible
Expand Down

0 comments on commit 08a97bd

Please sign in to comment.