Addressed Issue #5327
Deleted allow_email and also the function get_contribution_details() function in core/models.pymaster
parent
13351a582e
commit
3f2f62d3fe
|
@ -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',
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue