Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #906 from akatsoulas/1121868-django
Browse files Browse the repository at this point in the history
Change version to django 1.4.18.
  • Loading branch information
akatsoulas committed Jan 15, 2015
2 parents acbdc71 + 9285f9b commit c8bd8de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions remo/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from django.db import models
from django.db.models.signals import post_save

from remo.remozilla.models import Bug

Item = namedtuple('Item', ['name', 'user', 'priority', 'due_date'])


Expand Down Expand Up @@ -90,7 +92,5 @@ def resolve(instance, user, name):
action_items.update(completed=True, resolved=True)


from remo.remozilla.models import Bug

post_save.connect(ActionItem.create, sender=Bug,
dispatch_uid='create_action_items_bugzilla_sig')
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block object-tools-items %}
<li>
<a href="{% url 'admin:users_check_celery' %}">
<a href="{% url admin:users_check_celery %}">
Check Celery
</a>
</li>
Expand Down
10 changes: 7 additions & 3 deletions remo/remozilla/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime

from django.db.models.loading import get_model
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
Expand All @@ -10,8 +11,6 @@

import caching.base

from remo.dashboard.models import ActionItem, Item


ADD_RECEIPTS_ACTION = u'Add receipts for'
ADD_REPORT_ACTION = u'Add report for'
Expand Down Expand Up @@ -54,7 +53,7 @@ class Bug(caching.base.CachingMixin, models.Model):
council_member_assigned = models.BooleanField(default=False)
pending_mentor_validation = models.BooleanField(default=False)
budget_needinfo = models.ManyToManyField(User)
action_items = generic.GenericRelation(ActionItem)
action_items = generic.GenericRelation('dashboard.ActionItem')

objects = caching.base.CachingManager()

Expand All @@ -80,6 +79,8 @@ def waiting_photos(self):
def get_action_items(self):
# Avoid circular dependency
from remo.base.helpers import user_is_rep
from remo.dashboard.models import Item
ActionItem = get_model('dashboard', 'ActionItem')

if not self.assigned_to or not user_is_rep(self.assigned_to):
return []
Expand Down Expand Up @@ -123,6 +124,7 @@ def get_action_items(self):
def save(self, *args, **kwargs):
# Avoid circular dependency
from remo.base.helpers import user_is_rep
ActionItem = get_model('dashboard', 'ActionItem')

# Update action items
action_model = ContentType.objects.get_for_model(self)
Expand Down Expand Up @@ -197,6 +199,8 @@ def set_uppercase_pre_save(sender, instance, **kwargs):
def update_budget_needinfo_action_items(sender, instance, action, pk_set,
**kwargs):
"""Update ActionItem objects on needinfo change."""

ActionItem = get_model('dashboard', 'ActionItem')
name = '{0} {1}'.format(NEEDINFO_ACTION, instance.summary)
if action == 'post_remove':
for pk in pk_set:
Expand Down

0 comments on commit c8bd8de

Please sign in to comment.