Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove/wallposts #6206

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bluebottle/activities/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from bluebottle.updates.admin import UpdateInline
from bluebottle.updates.models import Update
from bluebottle.utils.widgets import get_human_readable_duration
from bluebottle.wallposts.models import Wallpost


@admin.register(Contributor)
Expand Down Expand Up @@ -356,7 +355,7 @@ class ActivityChildAdmin(PolymorphicChildModelAdmin, RegionManagerAdminMixin, St
inlines = (UpdateInline, )
form = ActivityForm

skip_on_duplicate = [Contributor, Wallpost, Follow, Message, Update]
skip_on_duplicate = [Contributor, Follow, Message, Update]

def get_formsets_with_inlines(self, request, obj=None):
formsets = super().get_formsets_with_inlines(request, obj)
Expand Down
2 changes: 0 additions & 2 deletions bluebottle/activities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class TeamActivityChoices(DjangoChoices):
messages = GenericRelation('notifications.Message')

follows = GenericRelation(Follow, object_id_field='instance_id')
wallposts = GenericRelation('wallposts.Wallpost', related_query_name='activity_wallposts')

auto_approve = True

Expand Down Expand Up @@ -390,5 +389,4 @@ def __str__(self):


from bluebottle.activities.signals import * # noqa
from bluebottle.activities.wallposts import * # noqa
from bluebottle.activities.states import * # noqa
83 changes: 0 additions & 83 deletions bluebottle/activities/tests/test_wallposts.py

This file was deleted.

37 changes: 0 additions & 37 deletions bluebottle/activities/wallposts.py

This file was deleted.

22 changes: 6 additions & 16 deletions bluebottle/common/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import

from future import standard_library

standard_library.install_aliases()
import json
import logging
Expand All @@ -11,7 +12,6 @@
from sorl.thumbnail.shortcuts import get_thumbnail

from bluebottle.clients.utils import LocalTenant, tenant_url
from bluebottle.wallposts.models import MediaWallpost

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -88,21 +88,11 @@ def _post_to_facebook(instance, tenant=None):
link = instance.content_object.get_absolute_url()

image = None
# This code is executed via Celery, we assume the MediaWallpostPhoto
# is saved and available on the instance. If the user uploaded
# photos with the MediaWallpost we take the first one and include it
# in the Facebook post. Otherwise we fallback to the project image.
if isinstance(instance, MediaWallpost) and instance.photos.count() > 0:
image = urljoin(base_url,
get_thumbnail(instance.photos.all()[0].photo,
"600x400").url
)
else:
if hasattr(instance.content_object, 'image') and instance.content_object.image:
image = urljoin(
base_url,
get_thumbnail(instance.content_object.image, "600x400").url
)
if hasattr(instance.content_object, 'image') and instance.content_object.image:
image = urljoin(
base_url,
get_thumbnail(instance.content_object.image, "600x400").url
)

description = getattr(
instance.content_object, 'pitch', instance.content_object.description
Expand Down
4 changes: 0 additions & 4 deletions bluebottle/initiatives/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ class Initiative(TriggerMixin, AnonymizationMixin, ValidatedModelMixin, models.M
)

follows = GenericRelation(Follow, object_id_field='instance_id')
wallposts = GenericRelation('wallposts.Wallpost', related_query_name='initiative_wallposts')

class Meta(object):
verbose_name = _("Initiative")
Expand Down Expand Up @@ -445,6 +444,3 @@ class Meta(object):

class JSONAPIMeta(object):
resource_name = 'themes'


from bluebottle.initiatives.wallposts import * # noqa
116 changes: 0 additions & 116 deletions bluebottle/initiatives/tests/test_wallposts.py

This file was deleted.

37 changes: 0 additions & 37 deletions bluebottle/initiatives/wallposts.py

This file was deleted.

Loading