Skip to content

Commit

Permalink
Merge pull request #1157 from ubyssey/remove-dispatch
Browse files Browse the repository at this point in the history
Remove Dispatch
  • Loading branch information
brittkhat authored Aug 17, 2023
2 parents 1900008 + 07ebf8c commit 7a4b577
Show file tree
Hide file tree
Showing 89 changed files with 33 additions and 5,984 deletions.
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __pycache__/
/localdev/
/tmp/
/cache/
/bin/

# swap files
*.swp
Expand All @@ -26,15 +27,18 @@ __pycache__/
node_modules/
yarn.lock

# Ignore Mac specific empty file
# Ignore macOS-specific empty file
.DS_Store

# Ignore settings for vscode except extensions.json
# Ignore settings for VS Code except extensions.json
.vscode

ubyssey/settings*.py

# Client secret for Travis
client-secret.json
# Keyfile for accessing gcs bucket

# Keyfile for accessing GCS bucket
gcs-local.json

pyvenv.cfg

ubyssey/settings*.py
8 changes: 0 additions & 8 deletions article/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Migration(migrations.Migration):
initial = True

dependencies = [
('dispatch', '0108_auto_20210511_1359'),
('wagtailcore', '0062_comment_models_and_pagesubscription'),
('taggit', '0003_taggeditem_add_unique_index'),
]
Expand Down Expand Up @@ -73,13 +72,6 @@ class Migration(migrations.Migration):
},
bases=('wagtailcore.page',),
),
migrations.CreateModel(
name='DispatchCounterpartSnippet',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dispatch_version', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='dispatch.article')),
],
),
migrations.CreateModel(
name='ArticlePageTag',
fields=[
Expand Down
6 changes: 0 additions & 6 deletions article/migrations/0002_auto_20210709_0344.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Migration(migrations.Migration):
('section', '0001_initial'),
('images', '0001_initial'),
('taggit', '0003_taggeditem_add_unique_index'),
('dispatch', '0108_auto_20210511_1359'),
]

operations = [
Expand All @@ -24,11 +23,6 @@ class Migration(migrations.Migration):
name='category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='section.categorysnippet'),
),
migrations.AddField(
model_name='articlepage',
name='dispatch_version',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='dispatch.article'),
),
migrations.AddField(
model_name='articlepage',
name='tags',
Expand Down
19 changes: 0 additions & 19 deletions article/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

from dbtemplates.models import Template as DBTemplate

from dispatch.models import Article

from django.db import models
from django.db.models import fields
from django.db.models.fields import CharField
Expand Down Expand Up @@ -109,15 +107,6 @@ class Meta:

#-----Snippet Models-----

@register_snippet
class DispatchCounterpartSnippet(models.Model):
dispatch_version = models.ForeignKey(
Article,
null=True,
blank=False,
on_delete=models.SET_NULL,
)

@register_snippet
class ArticleSeriesSnippet(ClusterableModel):
title = fields.CharField(
Expand Down Expand Up @@ -578,14 +567,6 @@ class ArticlePage(RoutablePageMixin, SectionablePage, UbysseyMenuMixin):
verbose_name="Is Explicit?",
help_text = "Check if this article contains advertiser-unfriendly content. Disables ads for this specific article."
)
#-----Migration stuff------
dispatch_version = models.ForeignKey(
# Used to map the article to a previous version that exists in Dispatch
"dispatch.Article",
null=True,
blank=True,
on_delete=models.SET_NULL,
)


#-----Hidden stuff: editors don't get to modify these, but they may be programatically changed-----
Expand Down
2 changes: 0 additions & 2 deletions article/templates/article/article_page_fw_story.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'article/article_page.html' %}
{% load static %}
{% load dispatch_tags %}
{% load wagtailimages_tags %}


Expand Down Expand Up @@ -89,7 +88,6 @@ <h1 class="headline">{{ self.title|safe }}</h1>
{% block right-column %}
<div class="right-column">
<div class="sidebar">
{% zone 'article-sidebar' %}
{% if explicit is not True %}
{% if self.minutes_to_read >= 3 %}
{% include 'objects/advertisement.html' with size='skyscraper' name='Box_A' id=3 article=article.id %}
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/author_pinned.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load dispatch_filters %}
{% load video_filters %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load humanize %}
Expand Down
1 change: 0 additions & 1 deletion article/templates/article/objects/bullet.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load dispatch_filters %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}

Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/cover_story.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load humanize %}
{% load dispatch_filters %}
{% load video_filters %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load articletags %}
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load dispatch_filters %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load video_filters %}

<article class="o-article o-article--default{% if padded %} o-article--padded{% endif %}">
{% if not hide_image and article.featured_media.first.image or article.featured_video %}
Expand Down
25 changes: 3 additions & 22 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import sys
import environ
import google_crc32c
from dispatch.apps import DispatchConfig

BASE_DIR = environ.Path(__file__) - 3
DISPATCH_APP_DIR = DispatchConfig.path

env = environ.Env() # will reinitialize later once "earliest" configs have been set

Expand Down Expand Up @@ -132,22 +130,12 @@
},
}

# TODO: Remove this line after Dispatch is removed as a dependency.
# This silences a reverse accessor clash error between the
# dispatch.User and users.User models.
SILENCED_SYSTEM_CHECKS = [
'fields.E304' # Reverse accessor clash error
]

# Set secret keys
SECRET_KEY = env('SECRET_KEY')
NOTIFICATION_KEY = env('NOTIFICATION_KEY')

# Application definition
INSTALLED_APPS = [
# NOTE: Until Dispatch is removed, this app must be loaded first so that
# the dispatch.User model can be overridden by the `users` app below.
'dispatch.apps.DispatchConfig',

# 'whitenoise.runserver_nostatic', # uncomment for testing "production-like" serving of collected static files with DEBUG=False
'ubyssey', #For some reason using ubyssey.apps.UbysseyConfig breaks static file finding?
Expand Down Expand Up @@ -193,14 +181,14 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.sites',

'rest_framework',
'rest_framework.authtoken',
'ubyssey.events',
'django_user_agents',
'django.contrib.admin',
'django_extensions',

'django.contrib.sites',
'dbtemplates',
'wagtailmodelchooser',
'wagtailmenus',
Expand Down Expand Up @@ -253,14 +241,7 @@
'dbtemplates.loader.Loader',
],
},
},
{
'NAME': 'dispatch',
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
DISPATCH_APP_DIR('templates')
],
},
}
]

TEMPLATES[0]['OPTIONS']['context_processors'].append("config.context_processors.get_light_mode")
Expand Down
1 change: 0 additions & 1 deletion config/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
GCS_CREDENTIALS_FILE = '../gcs-local.json'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

GCS_CREDENTIALS_FILE = '../gcs-local.json'

Expand Down
11 changes: 0 additions & 11 deletions home/blocks.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
"""
Blocks used on the home page of the site
"""
from ads.models import HomeSidebarPlacementOrderable
from article.models import ArticlePage
from section.models import CategorySnippet

from django import forms
from django.db.models import Q
from dispatch.models import Section

from wagtail.core import blocks
from wagtail.core.blocks import field_block

from wagtail.snippets.blocks import SnippetChooserBlock
from wagtail.images.blocks import ImageChooserBlock
from wagtailmodelchooser.blocks import ModelChooserBlock

class SectionChooserBlock(blocks.ChooserBlock):
# based off code from:
# https://groups.google.com/g/wagtail/c/S26h5GP9_Fk?pli=1
# maybe move to a different namespace
target_model = Section
widget = forms.Select

class HomepageFeaturedSectionBlock(blocks.StructBlock):

Expand Down
1 change: 0 additions & 1 deletion requirements-prd.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dispatch==2.0.6
Django==3.2.11
wagtail==2.15.3
git+https://github.com/ubyssey/[email protected]#egg=django-google-storage-updated
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dispatch==2.0.6
Django==3.2.11
wagtail==2.15.3
git+https://github.com/ubyssey/[email protected]#egg=django-google-storage-updated
Expand Down
Empty file removed ubyssey/events/__init__.py
Empty file.
Empty file removed ubyssey/events/api/__init__.py
Empty file.
41 changes: 0 additions & 41 deletions ubyssey/events/api/serializers.py

This file was deleted.

10 changes: 0 additions & 10 deletions ubyssey/events/api/urls.py

This file was deleted.

44 changes: 0 additions & 44 deletions ubyssey/events/api/views.py

This file was deleted.

Loading

0 comments on commit 7a4b577

Please sign in to comment.