diff --git a/src/olympia/addons/models.py b/src/olympia/addons/models.py index 58adb1beaf..3956e09c6c 100644 --- a/src/olympia/addons/models.py +++ b/src/olympia/addons/models.py @@ -630,11 +630,6 @@ class Addon(OnChangeMixin, ModelBase): # with on a file-by-file basis. return not self.is_listed - @property - def is_sideload(self): - # An add-on can side-load if it has been fully reviewed. - return self.status in (amo.STATUS_NOMINATED, amo.STATUS_PUBLIC) - @amo.cached_property(writable=True) def listed_authors(self): return UserProfile.objects.filter( diff --git a/src/olympia/devhub/forms.py b/src/olympia/devhub/forms.py index 86a495d868..07cf2349de 100644 --- a/src/olympia/devhub/forms.py +++ b/src/olympia/devhub/forms.py @@ -11,7 +11,6 @@ from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _, ugettext_lazy as _lazy import commonware -import waffle from quieter_formset.formset import BaseModelFormSet from olympia.access import acl @@ -538,15 +537,6 @@ class NewAddonForm(AddonUploadForm): help_text=_lazy( u'Check this option if you intend to distribute your add-on on ' u'your own and only need it to be signed by Mozilla.')) - is_sideload = forms.BooleanField( - initial=False, - required=False, - label=_lazy(u'This add-on will be bundled with an application ' - u'installer.'), - help_text=_lazy(u'Add-ons that are bundled with application ' - u'installers will be code reviewed ' - u'by Mozilla before they are signed and are held to a ' - u'higher quality standard.')) def clean(self): if not self.errors: @@ -557,16 +547,6 @@ class NewAddonForm(AddonUploadForm): class NewVersionForm(NewAddonForm): - nomination_type = forms.TypedChoiceField( - choices=( - ('', ''), - (amo.STATUS_NOMINATED, _lazy('Full Review')), - (amo.STATUS_UNREVIEWED, _lazy('Preliminary Review')), - ), - coerce=int, empty_value=None, required=False, - error_messages={ - 'required': _lazy(u'Please choose a review nomination type') - }) beta = forms.BooleanField( required=False, help_text=_lazy(u'A file with a version ending with ' @@ -576,9 +556,6 @@ class NewVersionForm(NewAddonForm): def __init__(self, *args, **kw): self.addon = kw.pop('addon') super(NewVersionForm, self).__init__(*args, **kw) - if (not waffle.flag_is_active(self.request, 'no-prelim-review') and - self.addon.status == amo.STATUS_NULL): - self.fields['nomination_type'].required = True def clean(self): if not self.errors: @@ -697,15 +674,6 @@ FileFormSet = modelformset_factory(File, formset=BaseFileFormSet, form=FileForm, can_delete=True, extra=0) -class ReviewTypeForm(forms.Form): - _choices = [(k, Addon.STATUS_CHOICES[k]) for k in - (amo.STATUS_UNREVIEWED, amo.STATUS_NOMINATED)] - review_type = forms.TypedChoiceField( - choices=_choices, widget=forms.HiddenInput, - coerce=int, empty_value=None, - error_messages={'required': _lazy(u'A review type must be selected.')}) - - class Step3Form(AddonFormBasic): description = TransField(widget=TransTextarea, required=False) tags = None diff --git a/src/olympia/devhub/helpers.py b/src/olympia/devhub/helpers.py index 6e14c9f560..66ea2471c4 100644 --- a/src/olympia/devhub/helpers.py +++ b/src/olympia/devhub/helpers.py @@ -12,7 +12,6 @@ from olympia.amo.urlresolvers import reverse from olympia.amo.helpers import breadcrumbs, impala_breadcrumbs, page_title from olympia.access import acl from olympia.addons.helpers import new_context -from olympia.addons.models import Addon from olympia.devhub.models import ActivityLog from olympia.compat.models import CompatReport from olympia.files.models import File @@ -124,26 +123,9 @@ def source_form_field(field): return {'field': field} -@register.function -def status_choices(addon): - """ - Return a dict like File.STATUS_CHOICES customized for the addon status. - """ - # Show "awaiting full review" for unreviewed files on that track. - choices = dict(File.STATUS_CHOICES) - if addon.status in (amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED, - amo.STATUS_PUBLIC): - choices[amo.STATUS_UNREVIEWED] = ( - Addon.STATUS_CHOICES[amo.STATUS_NOMINATED]) - elif addon.status in (amo.STATUS_UNREVIEWED, amo.STATUS_LITE): - choices[amo.STATUS_UNREVIEWED] = ( - Addon.STATUS_CHOICES[amo.STATUS_UNREVIEWED]) - return choices - - @register.inclusion_tag('devhub/versions/file_status_message.html') -def file_status_message(file, addon): - choices = status_choices(addon) +def file_status_message(file): + choices = File.STATUS_CHOICES return {'fileid': file.id, 'platform': file.get_platform_display(), 'created': datetime(file.created), 'status': choices[file.status], @@ -152,10 +134,10 @@ def file_status_message(file, addon): @register.function -def dev_files_status(files, addon): +def dev_files_status(files): """Group files by their status (and files per status).""" status_count = defaultdict(int) - choices = status_choices(addon) + choices = File.STATUS_CHOICES for file in files: status_count[file.status] += 1 @@ -168,12 +150,9 @@ def dev_files_status(files, addon): def status_class(addon): classes = { amo.STATUS_NULL: 'incomplete', - amo.STATUS_UNREVIEWED: 'unreviewed', amo.STATUS_NOMINATED: 'nominated', amo.STATUS_PUBLIC: 'fully-approved', amo.STATUS_DISABLED: 'admin-disabled', - amo.STATUS_LITE: 'lite', - amo.STATUS_LITE_AND_NOMINATED: 'lite-nom', amo.STATUS_DELETED: 'deleted', amo.STATUS_REJECTED: 'rejected', } diff --git a/src/olympia/devhub/tasks.py b/src/olympia/devhub/tasks.py index ae496a764b..7a4df6f92a 100644 --- a/src/olympia/devhub/tasks.py +++ b/src/olympia/devhub/tasks.py @@ -62,31 +62,25 @@ def validate(file_, listed=None, subtask=None): return result -def validate_and_submit(addon, file_, listed=None, - disallow_preliminary_review=False): +def validate_and_submit(addon, file_, listed=None): return validate( - file_, listed=listed, subtask=submit_file.si( - addon.pk, file_.pk, - disallow_preliminary_review=disallow_preliminary_review)) + file_, listed=listed, subtask=submit_file.si(addon.pk, file_.pk)) @task @write -def submit_file(addon_pk, upload_pk, disallow_preliminary_review=False): +def submit_file(addon_pk, upload_pk): addon = Addon.unfiltered.get(pk=addon_pk) upload = FileUpload.objects.get(pk=upload_pk) if upload.passed_all_validations: - create_version_for_upload( - addon, upload, - disallow_preliminary_review=disallow_preliminary_review) + create_version_for_upload(addon, upload) else: log.info('Skipping version creation for {upload_uuid} that failed ' 'validation'.format(upload_uuid=upload.uuid)) @atomic -def create_version_for_upload(addon, upload, - disallow_preliminary_review=False): +def create_version_for_upload(addon, upload): fileupload_exists = addon.fileupload_set.filter( created__gt=upload.created, version=upload.version).exists() version_exists = Version.unfiltered.filter( @@ -106,13 +100,8 @@ def create_version_for_upload(addon, upload, # The add-on's status will be STATUS_NULL when its first version is # created because the version has no files when it gets added and it # gets flagged as invalid. We need to manually set the status. - # TODO: Handle sideload add-ons. This assumes the user wants a prelim - # review since listed and sideload aren't supported for creation yet. if addon.status == amo.STATUS_NULL: - if disallow_preliminary_review: - addon.update(status=amo.STATUS_NOMINATED) - else: - addon.update(status=amo.STATUS_LITE) + addon.update(status=amo.STATUS_NOMINATED) auto_sign_version(version, is_beta=version.is_beta) diff --git a/src/olympia/devhub/templates/devhub/addons/edit/basic.html b/src/olympia/devhub/templates/devhub/addons/edit/basic.html index 5ba6323656..0d6d44a55a 100644 --- a/src/olympia/devhub/templates/devhub/addons/edit/basic.html +++ b/src/olympia/devhub/templates/devhub/addons/edit/basic.html @@ -67,7 +67,6 @@ {% endif %} - {% if waffle.flag('no-prelim-review') %}
- {% if addon.status == amo.STATUS_UNREVIEWED %} - {{ _('Your add-on has been submitted to the Preliminary Review queue.') }} - {% elif addon.status == amo.STATUS_NOMINATED %} + {% if addon.status == amo.STATUS_NOMINATED %} {{ _('Your add-on has been submitted to the Full Review queue.') }} {% endif %}
@@ -47,7 +45,7 @@{{ _('Your add-on has been signed and it\'s ready to use. You can download it here:') }} @@ -59,9 +57,7 @@
{% else %}- {% if addon.status == amo.STATUS_UNREVIEWED %} - {{ _('Your add-on has been submitted to the Unlisted Preliminary Review queue.') }} - {% elif addon.status == amo.STATUS_NOMINATED %} + {% if addon.status == amo.STATUS_NOMINATED %} {{ _('Your add-on has been submitted to the Unlisted Full Review queue.') }} {% endif %}
diff --git a/src/olympia/devhub/templates/devhub/addons/submit/select-review.html b/src/olympia/devhub/templates/devhub/addons/submit/select-review.html deleted file mode 100644 index 602c823fd0..0000000000 --- a/src/olympia/devhub/templates/devhub/addons/submit/select-review.html +++ /dev/null @@ -1,68 +0,0 @@ -{% extends "devhub/addons/submit/base.html" %} - -{% set learn_more_url = 'https://developer.mozilla.org/en-US/Add-ons/AMO/Policy/Reviews' %} - -{% block title %}{{ dev_page_title(_('Step 6'), addon) }}{% endblock %} - -{% block primary %} -- {% trans %} - All add-ons hosted in our gallery must be reviewed by an editor before - they appear in categories or search results. While waiting for review, - your add-on can still be accessed through its direct URL. Please choose - the review process below that best fits your add-on. - {% endtrans %} -
- -{% endblock %} diff --git a/src/olympia/devhub/templates/devhub/addons/submit/sidebar.html b/src/olympia/devhub/templates/devhub/addons/submit/sidebar.html index 93458e1c06..c3602a1b58 100644 --- a/src/olympia/devhub/templates/devhub/addons/submit/sidebar.html +++ b/src/olympia/devhub/templates/devhub/addons/submit/sidebar.html @@ -4,24 +4,14 @@ {# List of steps: (text, class). A class of 'all' means the step is relevant to listed or unlisted addons, a class of 'listed' means it's only relevant to listed addons, not unlisted ones. #} -{% if waffle.flag('no-prelim-review') %} - {% set NAV = ((_('Getting Started'), 'all'), +{% set NAV = ((_('Getting Started'), 'all'), (_('Upload your add-on'), 'all'), (_('Describe your add-on'), 'all'), (_('Add images'), 'listed'), (_('Select a license'), 'listed'), - (_('n/a'), 'hidden'), (_("You're done!"), 'all')) %} -{% else %} - {% set NAV = ((_('Getting Started'), 'all'), - (_('Upload your add-on'), 'all'), - (_('Describe your add-on'), 'all'), - (_('Add images'), 'listed'), - (_('Select a license'), 'listed'), - (_('Select a review process'), 'listed'), - (_("You're done!"), 'all')) %} -{% endif %} -{% set MAX = 7 %} + +{% set MAX = 6 %} {% set BASE = 'devhub.submit.%s' %}Thanks for submitting your {{ app }} Add-on to addons.mozilla.org (AMO)! Your add-on has been added to the Full Review queue.
-{% else %} -Thanks for submitting your {{ app }} Add-on to addons.mozilla.org (AMO)! Your add-on has been added to the Preliminary Review queue.
-{% endif %}We will contact you if we need more information. After it is reviewed, you will receive an email notification and your add-on will appear in categories and search results. While awaiting review, your add-on can still be accessed and installed directly from its detail page:
diff --git a/src/olympia/devhub/templates/devhub/includes/addon_details.html b/src/olympia/devhub/templates/devhub/includes/addon_details.html index aa9b4d189d..d0d8e61cfe 100644 --- a/src/olympia/devhub/templates/devhub/includes/addon_details.html +++ b/src/olympia/devhub/templates/devhub/includes/addon_details.html @@ -26,16 +26,6 @@ {% elif addon.status == amo.STATUS_NULL %} {{ status_and_tip(addon, _('Please complete your add-on.'), url=url('devhub.submit.resume', addon.slug)) }} - {% elif addon.status == amo.STATUS_PENDING %} - {{ status_and_tip(addon, _('You will receive an email when the review is complete.')) }} - {% elif addon.status == amo.STATUS_UNREVIEWED %} - {{ status_and_tip(addon, - _("You will receive an email when the review is complete. Until " - "then, your add-on is not listed in our gallery but can be " - "accessed directly from its details page.") - if addon.is_listed else - _("You will receive an email when the review is " - "complete and your add-on is signed.")) }} {% elif addon.status == amo.STATUS_NOMINATED %} {{ status_and_tip(addon, _("You will receive an email when the review is complete. Until " @@ -57,23 +47,6 @@ "longer shown in our gallery. If you have any questions, " "please email amo-admins@mozilla.org."), url=(addon.get_dev_url('versions') + '#version-upload')) }} - {% elif addon.status == amo.STATUS_LITE %} - {{ status_and_tip(addon, - _("Your add-on is displayed in our gallery as experimental " - "and users are receiving automatic updates. Some features " - "are unavailable to your add-on.") - if addon.is_listed else - _('Your add-on has been signed.')) }} - {% elif addon.status == amo.STATUS_LITE_AND_NOMINATED %} - {{ status_and_tip(addon, - _("You will receive an email when the full review is complete. " - "Until then, your add-on is displayed in our gallery as " - "experimental and users are receiving automatic updates. " - "Some features are unavailable to your add-on.") - if addon.is_listed else - _("You will receive an email when the full review is " - "complete, making you able to bundle your add-on with an " - "application installer.")) }} {% endif %} diff --git a/src/olympia/devhub/templates/devhub/includes/version_file.html b/src/olympia/devhub/templates/devhub/includes/version_file.html index de82dbf4e2..9b3b5ab1fb 100644 --- a/src/olympia/devhub/templates/devhub/includes/version_file.html +++ b/src/olympia/devhub/templates/devhub/includes/version_file.html @@ -6,7 +6,7 @@