Commit 7a3d8066 authored by Michal Čihař's avatar Michal Čihař

Add field for tracking project ownership

Issue #636
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 76ae4fd7
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('trans', '0022_auto_20150309_0932'),
]
operations = [
migrations.AddField(
model_name='project',
name='owner',
field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text='Owner of the project.', null=True),
preserve_default=True,
),
]
......@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _, ugettext_lazy
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Group
from django.core.cache import cache
......@@ -129,6 +129,15 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
'Whether to allow updating this repository by remote hooks.'
)
)
owner = models.ForeignKey(
User,
null=True,
db_index=True,
blank=True,
help_text=ugettext_lazy(
'Owner of the project.'
)
)
objects = ProjectManager()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment