Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressed Issue #5327 #5383

Merged
merged 2 commits into from Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions readthedocs/core/migrations/0006_remove_userprofile_allow_email.py
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-01 17:30
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0005_migrate-old-passwords'),
]

operations = [
migrations.RemoveField(
model_name='userprofile',
name='allow_email',
),
]
21 changes: 0 additions & 21 deletions readthedocs/core/models.py
Expand Up @@ -32,11 +32,6 @@ class UserProfile(models.Model):
help_text=_('If unchecked, you will still see community ads.'),
default=True,
)
allow_email = models.BooleanField(
_('Allow email'),
help_text=_('Show your email on VCS contributions.'),
default=True,
)

def __str__(self):
return (
Expand All @@ -49,19 +44,3 @@ def get_absolute_url(self):
'profiles_profile_detail',
kwargs={'username': self.user.username},
)

def get_contribution_details(self):
"""
Get the line to put into commits to attribute the author.

Returns a tuple (name, email)
"""
if self.user.first_name and self.user.last_name:
name = '{} {}'.format(self.user.first_name, self.user.last_name)
else:
name = self.user.username
if self.allow_email:
email = self.user.email
else:
email = STANDARD_EMAIL
return (name, email)