Skip to content

Commit 3f2f62d

Browse files
committed
Addressed Issue readthedocs#5327
Deleted allow_email and also the function get_contribution_details() function in core/models.py
1 parent 13351a5 commit 3f2f62d

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.20 on 2019-03-01 17:30
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('core', '0005_migrate-old-passwords'),
12+
]
13+
14+
operations = [
15+
migrations.RemoveField(
16+
model_name='userprofile',
17+
name='allow_email',
18+
),
19+
]

readthedocs/core/models.py

-20
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ class UserProfile(models.Model):
3232
help_text=_('If unchecked, you will still see community ads.'),
3333
default=True,
3434
)
35-
allow_email = models.BooleanField(
36-
_('Allow email'),
37-
help_text=_('Show your email on VCS contributions.'),
38-
default=True,
39-
)
4035

4136
def __str__(self):
4237
return (
@@ -50,18 +45,3 @@ def get_absolute_url(self):
5045
kwargs={'username': self.user.username},
5146
)
5247

53-
def get_contribution_details(self):
54-
"""
55-
Get the line to put into commits to attribute the author.
56-
57-
Returns a tuple (name, email)
58-
"""
59-
if self.user.first_name and self.user.last_name:
60-
name = '{} {}'.format(self.user.first_name, self.user.last_name)
61-
else:
62-
name = self.user.username
63-
if self.allow_email:
64-
email = self.user.email
65-
else:
66-
email = STANDARD_EMAIL
67-
return (name, email)

0 commit comments

Comments
 (0)