Addressed Issue #5327

Deleted allow_email and also the function get_contribution_details() function in core/models.py
master
Rishi Banerjee 2019-03-01 23:01:05 +05:30
parent 13351a582e
commit 3f2f62d3fe
2 changed files with 19 additions and 20 deletions

View File

@ -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',
),
]

View File

@ -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 (
@ -50,18 +45,3 @@ class UserProfile(models.Model):
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)