Skip to content

Commit

Permalink
Move core to modernomad
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-s authored and jessykate committed Mar 21, 2019
1 parent c797616 commit 7a3eee1
Show file tree
Hide file tree
Showing 231 changed files with 194 additions and 194 deletions.
2 changes: 1 addition & 1 deletion api/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.serializers import *
from modernomad.core.serializers import *
from django import forms


Expand Down
2 changes: 1 addition & 1 deletion api/commands/bookings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from api.command import *
from core.models import Resource, Booking, Use
from modernomad.core.models import Resource, Booking, Use
from django.db import transaction


Expand Down
4 changes: 2 additions & 2 deletions api/commands/capacities.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from api.command import *
from datetime import datetime
from core.models import Resource
from django.core.exceptions import ValidationError
from core.models import CapacityChange
from modernomad.core.models import Resource
from modernomad.core.models import CapacityChange

def user_can_administer_a_resource(user, resource):
return (
Expand Down
4 changes: 2 additions & 2 deletions api/tests/commands/test_availability_commands.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.test import TestCase
import unittest

from core.factories import *
from modernomad.core.factories import *
from api.commands.capacities import *
from core.models import *
from modernomad.core.models import *

@unittest.skip("needs fixing after refactoring in ac1c446e4758b2552e5d1bc08c9f832faa31a3a0")
class AddCapacityChangeTestCase(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion api/tests/commands/test_booking_commands.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.test import TestCase
from api.commands.bookings import *
from datetime import date, timedelta
from core.factories import *
from modernomad.core.factories import *


class CommandErrorMatchers:
Expand Down
6 changes: 3 additions & 3 deletions api/views/capacities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from api.utils.http import JSONResponse
from api.commands.capacities import *

from core.models import CapacityChange, Resource
from core.serializers import CapacityChangeSerializer
from core.data_fetchers import SerializedResourceCapacity
from modernomad.core.models import CapacityChange, Resource
from modernomad.core.serializers import CapacityChangeSerializer
from modernomad.core.data_fetchers import SerializedResourceCapacity
from django.utils import timezone
import json

Expand Down
56 changes: 0 additions & 56 deletions core/urls/location.py

This file was deleted.

2 changes: 1 addition & 1 deletion gather/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

logger = logging.getLogger(__name__)

from core.emails.mailgun import mailgun_send
from modernomad.core.emails.mailgun import mailgun_send

def new_event_notification(event, location):
# notify the event admins that a new event has been proposed
Expand Down
2 changes: 1 addition & 1 deletion gather/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.db.models.signals import post_save
from django.utils import timezone

from core.models import Location
from modernomad.core.models import Location


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion gather/syndication.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django_ical.views import ICalFeed
from django.core.urlresolvers import reverse
from gather.models import Event
from core.models import Location
from modernomad.core.models import Location
from django.shortcuts import get_object_or_404

class PublicEventsFeed(ICalFeed):
Expand Down
4 changes: 2 additions & 2 deletions gather/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

from modernomad.log import catch_exceptions
from gather.models import Event, EventNotifications
from core.models import Location
from core.emails.mailgun import mailgun_send
from modernomad.core.models import Location
from modernomad.core.emails.mailgun import mailgun_send

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions gather/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from django.shortcuts import get_object_or_404

from gather.forms import EventForm, EventEmailTemplateForm
from core.forms import UserProfileForm
from gather.emails import new_event_notification, event_approved_notification, event_published_notification, mailgun_send
from core.models import Location
from modernomad.core.forms import UserProfileForm
from modernomad.core.models import Location

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion graphapi/schemas/bookings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from api.commands.bookings import RequestBooking
from graphapi.schemas.resources import ResourceNode
from core.models import Resource, Booking
from modernomad.core.models import Resource, Booking


def commandErrorsToGraphQL(errors):
Expand Down
2 changes: 1 addition & 1 deletion graphapi/schemas/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField

from core.models import Location, Fee, LocationFee
from modernomad.core.models import Location, Fee, LocationFee
from .resources import ResourceNode


Expand Down
2 changes: 1 addition & 1 deletion graphapi/schemas/occupants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from graphene_django.types import DjangoObjectType
from graphene.types import String
from graphene_django.filter import DjangoFilterConnectionField
from core.models import Use, Location
from modernomad.core.models import Use, Location
from django.contrib.auth.models import User
from django.utils import timezone

Expand Down
2 changes: 1 addition & 1 deletion graphapi/schemas/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from datetime import timedelta
from core.models import Resource, Backing
from modernomad.core.models import Resource, Backing

import logging

Expand Down
2 changes: 1 addition & 1 deletion graphapi/schemas/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from graphene_django.filter import DjangoFilterConnectionField

from django.contrib.auth.models import User
from core.models import UserProfile
from modernomad.core.models import UserProfile


class UserProfileNode(DjangoObjectType):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions core/admin.py → modernomad/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from django.contrib.auth.models import User
from django.contrib import messages

from core.models import *
from modernomad.core.models import *
from gather.models import EventAdminGroup
from core.emails.messages import *
from modernomad.core.emails.messages import *

class EmailTemplateAdmin(admin.ModelAdmin):
model = EmailTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from calendar import HTMLCalendar
from datetime import date, timedelta
from core.models import Booking, Resource
from modernomad.core.models import Booking, Resource

from django.utils.html import conditional_escape as esc

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from core.models import Location
from modernomad.core.models import Location
import re

def network_locations(request):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from core.models import CapacityChange
from core.serializers import CapacityChangeSerializer
from modernomad.core.models import CapacityChange
from modernomad.core.serializers import CapacityChangeSerializer


class ResourceCapacity:
Expand Down
2 changes: 1 addition & 1 deletion core/decorators.py → modernomad/core/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponseRedirect
from core.models import get_location
from modernomad.core.models import get_location
from functools import wraps
from django.conf import settings

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
from django.template.loader import get_template
from django.template import Template, TemplateDoesNotExist
from django.contrib.sites.models import Site
from core.models import get_location, Booking, LocationEmailTemplate, Use
from django.http import HttpResponse, HttpResponseRedirect
from gather.tasks import published_events_today_local, events_pending
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone
from core.models import Booking, Subscription, Use
from gather.models import Event, EventAdminGroup, EventSeries, EventNotifications
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from sentry_sdk import capture_exception, capture_message
from modernomad.core.models import Booking, Subscription, Use
from modernomad.core.models import get_location, Booking, LocationEmailTemplate, Use
from modernomad.core.emails.mailgun import mailgun_send

import json
import requests
import datetime
from django.utils import translation
from core.emails.mailgun import mailgun_send

import logging
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion core/factories.py → modernomad/core/factories.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import factory
from core.models import *
from modernomad.core.models import *


class LocationFactory(factory.DjangoModelFactory):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from . import factory
from core import models
from modernomad.core import models
from .user import UserFactory


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from django.contrib.flatpages.models import FlatPage

from core.models import Location
from core.models import Resource
from core.models import LocationFee
from core.models import LocationMenu
from core.models import LocationFlatPage
from core.models import LocationEmailTemplate
from core.models import CapacityChange
from core.models import Fee
from core.models import Backing
from modernomad.core.models import Location
from modernomad.core.models import Resource
from modernomad.core.models import LocationFee
from modernomad.core.models import LocationMenu
from modernomad.core.models import LocationFlatPage
from modernomad.core.models import LocationEmailTemplate
from modernomad.core.models import CapacityChange
from modernomad.core.models import Fee
from modernomad.core.models import Backing
from . import factory
from .user import UserFactory, SuperUserFactory
from .accounts import USDAccountFactory
Expand Down Expand Up @@ -79,7 +79,7 @@ def house_admins(self, create, extracted, **kwargs):
# A list of groups were passed in, use them
for user in extracted:
self.house_admins.add(user)

# Always add superuser
self.house_admins.add(SuperUserFactory())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from . import factory
from core import models
from modernomad.core import models

from .user import UserFactory
from .location import LocationFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib.auth import get_user_model
from core.models import UserProfile
from modernomad.core.models import UserProfile

from . import factory

Expand Down
2 changes: 1 addition & 1 deletion core/forms.py → modernomad/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from django.template import Template, Context
from core.models import UserProfile, Use, Booking, EmailTemplate, Resource, Location, LocationMenu, Subscription, Subscription
from modernomad.core.models import UserProfile, Use, Booking, EmailTemplate, Resource, Location, LocationMenu, Subscription, Subscription
from django.contrib.sites.models import Site

from django.contrib.auth.forms import UserCreationForm, UserChangeForm
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from faker import Faker

from core.factory_apps.communication import EmailtemplateFactory
from core.factory_apps.location import LocationFactory, ResourceFactory
from core.factory_apps.user import SuperUserFactory, UserFactory
from modernomad.core.factory_apps.communication import EmailtemplateFactory
from modernomad.core.factory_apps.location import LocationFactory, ResourceFactory
from modernomad.core.factory_apps.user import SuperUserFactory, UserFactory


class Command(BaseCommand):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals

from django.db import models, migrations
import core.models
import modernomad.core.models
from django.conf import settings


Expand Down Expand Up @@ -63,7 +63,7 @@ class Migration(migrations.Migration):
('address', models.CharField(max_length=300)),
('latitude', models.FloatField()),
('longitude', models.FloatField()),
('image', models.ImageField(help_text=b'Requires an image with proportions 1400px wide x 300px high', upload_to=core.models.location_img_upload_to)),
('image', models.ImageField(help_text=b'Requires an image with proportions 1400px wide x 300px high', upload_to=modernomad.core.models.location_img_upload_to)),
('stay_page', models.TextField(default=b'This is the page which has some descriptive text at the top (this text), and then lists the available rooms. HTML is supported.')),
('front_page_stay', models.TextField(default=b'This is the middle of three sections underneath the main landing page text to entice people to stay with you, and then links to the stay page (above). HTML is supported.')),
('front_page_participate', models.TextField(default=b'This is far right of three sections underneath the main landing page text to tell people how to get involved with your community. There is a link to the Events page underneath. HTML is supported. ')),
Expand Down Expand Up @@ -205,7 +205,7 @@ class Migration(migrations.Migration):
('cancellation_policy', models.CharField(default=b'24 hours', max_length=400)),
('shared', models.BooleanField(default=False, verbose_name=b'Is this a hostel/shared accommodation room?')),
('beds', models.IntegerField()),
('image', models.ImageField(null=True, upload_to=core.models.resource_img_upload_to, blank=True)),
('image', models.ImageField(null=True, upload_to=modernomad.core.models.resource_img_upload_to, blank=True)),
('location', models.ForeignKey(related_name='rooms', to='core.Location', null=True)),
('residents', models.ManyToManyField(help_text=b'This field is optional.', related_name='residents', null=True, to=settings.AUTH_USER_MODEL, blank=True)),
],
Expand All @@ -231,7 +231,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('updated', models.DateTimeField(auto_now=True)),
('image', models.ImageField(help_text=b'Image should have square dimensions.', upload_to=core.models.profile_img_upload_to)),
('image', models.ImageField(help_text=b'Image should have square dimensions.', upload_to=modernomad.core.models.profile_img_upload_to)),
('image_thumb', models.ImageField(null=True, upload_to=b'avatars/%Y/%m/%d/', blank=True)),
('bio', models.TextField(null=True, verbose_name=b'About you', blank=True)),
('links', models.TextField(help_text=b'Comma-separated', null=True, blank=True)),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7a3eee1

Please sign in to comment.