Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/2016-09-29'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pike committed Sep 29, 2016
2 parents 28f7edd + 9576ba8 commit 0a13872
Show file tree
Hide file tree
Showing 30 changed files with 126 additions and 1,578 deletions.
6 changes: 3 additions & 3 deletions apps/l10nstats/tests.py
Expand Up @@ -43,7 +43,7 @@ def _create_active_run(self):
def test_history_static_files(self):
"""render the tree_status view and check that all static files are
accessible"""
appver, tree, milestone = self._create_appver_tree_milestone()
appver, tree = self._create_appver_tree()
url = reverse('locale-tree-history')
response = self.client.get(url)
eq_(response.status_code, 404)
Expand All @@ -64,13 +64,13 @@ def test_history_static_files(self):
def test_tree_status_static_files(self):
"""render the tree_status view and check that all static files are
accessible"""
appver, tree, milestone = self._create_appver_tree_milestone()
appver, tree = self._create_appver_tree()

url = reverse('tree-history', args=['XXX'])
response = self.client.get(url)
eq_(response.status_code, 404)

# _create_appver_milestone() creates a mock tree
# _create_appver_tree() creates a mock tree
url = reverse('tree-history', args=[tree.code])
response = self.client.get(url)
eq_(response.status_code, 200)
Expand Down
9 changes: 1 addition & 8 deletions apps/shipping/admin.py
Expand Up @@ -3,18 +3,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import

from shipping.models import (
Action, Milestone, Event, Application, AppVersion)
from shipping.models import Action, Application, AppVersion
from django.contrib import admin


class MilestoneAdmin(admin.ModelAdmin):
exclude = ('signoffs',)


admin.site.register(Application)
admin.site.register(AppVersion)
admin.site.register(AppVersion.trees.through)
admin.site.register(Milestone, MilestoneAdmin)
admin.site.register(Action)
admin.site.register(Event)
2 changes: 1 addition & 1 deletion apps/shipping/fixtures/example.json
@@ -1 +1 @@
[{"pk": 1, "model": "shipping.application", "fields": {"code": "fx", "name": "Firefox"}}, {"pk": 1, "model": "shipping.appversion", "fields": {"app": 1, "version": "3.5", "tree": 1, "codename": "Shiretoko"}}, {"pk": 1, "model": "shipping.milestone", "fields": {"appver": 1, "code": "fx35b4", "name": "beta 4"}}, {"pk": 1, "model": "shipping.event", "fields": {"date": "2009-04-05", "type": 0, "name": "String freeze", "milestone": 1}}, {"pk": 2, "model": "shipping.event", "fields": {"date": "2009-04-15", "type": 1, "name": "Deadline", "milestone": 1}}]
[{"pk": 1, "model": "shipping.application", "fields": {"code": "fx", "name": "Firefox"}}, {"pk": 1, "model": "shipping.appversion", "fields": {"app": 1, "version": "3.5", "tree": 1, "codename": "Shiretoko"}}]
7 changes: 2 additions & 5 deletions apps/shipping/forms.py
Expand Up @@ -3,10 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import

import datetime
from django import forms
from django.conf import settings
from shipping.models import Milestone, AppVersion
from shipping.models import AppVersion


class ModelInstanceField(forms.fields.Field):
Expand All @@ -27,8 +25,7 @@ def to_python(self, value):


class SignoffFilterForm(forms.Form):
ms = ModelInstanceField(Milestone, key='code', required=False)
av = ModelInstanceField(AppVersion, key='code', required=False)
av = ModelInstanceField(AppVersion, key='code')
up_until = forms.fields.DateTimeField(required=False)


Expand Down
56 changes: 0 additions & 56 deletions apps/shipping/management/commands/update_l10n.py

This file was deleted.

60 changes: 0 additions & 60 deletions apps/shipping/models.py
Expand Up @@ -165,66 +165,6 @@ def instance(self):
)


class Milestone(models.Model):
""" stores unique milestones like fx35b4
The milestone is open for signoff between string_freeze and code
"""
UPCOMING, OPEN, SHIPPED = range(3)
code = models.CharField(max_length=30, unique=True)
name = models.CharField(max_length=50)
appver = models.ForeignKey(AppVersion)
signoffs = models.ManyToManyField(Signoff, related_name='shipped_in',
blank=True)
status = models.IntegerField(choices=STATUS_CHOICES, default=0)

class Meta:
permissions = (('can_open', 'Can open a Milestone for sign-off'),
('can_ship', 'Can ship a Milestone'))

def get_start_event(self):
try:
return Event.objects.get(type=0, milestone=self)
except:
return None

def get_end_event(self):
try:
return Event.objects.get(type=1, milestone=self)
except:
return None

start_event = property(get_start_event)
end_event = property(get_end_event)

def __unicode__(self):
if self.name is not None:
rv = '%s %s' % (self.appver.app.name, self.appver.version)
if self.name:
if self.name.startswith('.'):
rv += self.name
else:
rv += ' ' + self.name
return rv
else:
return self.code


TYPE_CHOICES = (
(0, 'signoff start'),
(1, 'signoff end'),
)


class Event(models.Model):
name = models.CharField(max_length=50)
type = models.IntegerField(choices=TYPE_CHOICES)
date = models.DateField()
milestone = models.ForeignKey(Milestone, related_name='events')

def __unicode__(self):
return '%s for %s (%s)' % (self.name, self.milestone, self.date)


class SignoffForm(ModelForm):
class Meta:
model = Signoff
Expand Down
20 changes: 0 additions & 20 deletions apps/shipping/static/shipping/css/about-milestone.css

This file was deleted.

8 changes: 0 additions & 8 deletions apps/shipping/static/shipping/css/milestones.css

This file was deleted.

33 changes: 0 additions & 33 deletions apps/shipping/static/shipping/js/about-milestone.js

This file was deleted.

10 changes: 0 additions & 10 deletions apps/shipping/static/shipping/js/milestones.js

This file was deleted.

25 changes: 0 additions & 25 deletions apps/shipping/static/shipping/js/select-milestones.js

This file was deleted.

0 comments on commit 0a13872

Please sign in to comment.