Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge 3c5f887 into 6144004
Browse files Browse the repository at this point in the history
  • Loading branch information
filwaitman committed Feb 22, 2018
2 parents 6144004 + 3c5f887 commit 15b36ee
Show file tree
Hide file tree
Showing 61 changed files with 119 additions and 5,909 deletions.
57 changes: 30 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,37 @@ env:
matrix:
# Matrix-size reduction strategies:
# PY strategy: do not test 3.3 at all.
# DB strategy: only with SQLite as we're not using any raw queries.
# FE strategy: only test on Django/CMS combinations, but place tests on
# different Python ENVs if possible.
# FE strategy: only test on Django/CMS combinations, but place tests on different Python ENVs if possible.
- TOXENV=flake8
- TOXENV=py35-dj19-sqlite-cms34
- TOXENV=py35-dj19-sqlite-cms33-fe FE=1
- TOXENV=py35-dj19-sqlite-cms32
- TOXENV=py34-dj19-sqlite-cms34
- TOXENV=py34-dj19-sqlite-cms33
- TOXENV=py34-dj19-sqlite-cms32
- TOXENV=py27-dj19-sqlite-cms34
- TOXENV=py27-dj19-sqlite-cms33
- TOXENV=py27-dj19-sqlite-cms32
- TOXENV=py35-dj18-sqlite-cms34
- TOXENV=py35-dj18-sqlite-cms33
- TOXENV=py35-dj18-sqlite-cms32
- TOXENV=py34-dj18-sqlite-cms34
- TOXENV=py34-dj18-sqlite-cms33
- TOXENV=py34-dj18-sqlite-cms32
- TOXENV=py27-dj18-sqlite-cms34
- TOXENV=py27-dj18-sqlite-cms33-fe FE=1
- TOXENV=py27-dj18-sqlite-cms32
- TOXENV=py34-dj17-sqlite-cms32
- TOXENV=py33-dj17-sqlite-cms32
- TOXENV=py27-dj17-sqlite-cms32
- TOXENV=py33-dj16-sqlite-cms32
- TOXENV=py27-dj16-sqlite-cms32
- TOXENV=py26-dj16-sqlite-cms32

- TOXENV=py35-dj110-cms35
- TOXENV=py35-dj110-cms34
- TOXENV=py34-dj110-cms35
- TOXENV=py34-dj110-cms34
- TOXENV=py27-dj110-cms35
- TOXENV=py27-dj110-cms34

- TOXENV=py35-dj19-cms34
- TOXENV=py35-dj19-cms33
- TOXENV=py35-dj19-cms32
- TOXENV=py34-dj19-cms34
- TOXENV=py34-dj19-cms33
- TOXENV=py34-dj19-cms32
- TOXENV=py27-dj19-cms34
- TOXENV=py27-dj19-cms33
- TOXENV=py27-dj19-cms32
# - TOXENV=py35-dj19-cms33-fe FE=1

- TOXENV=py35-dj18-cms34
- TOXENV=py35-dj18-cms33
- TOXENV=py35-dj18-cms32
- TOXENV=py34-dj18-cms34
- TOXENV=py34-dj18-cms33
- TOXENV=py34-dj18-cms32
- TOXENV=py27-dj18-cms34
- TOXENV=py27-dj18-cms33
- TOXENV=py27-dj18-cms32
# - TOXENV=py27-dj18-cms33-fe FE=1

cache:
directories:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ request, please review our
Requirements
************

* django CMS 3.0.12, 3.1.x or 3.2.x
* Django 1.6.9, 1.7.x, or 1.8.x
* django CMS 3.2+
* Django 1.8 - 1.10


.. |PyPI_Version| image:: http://img.shields.io/pypi/v/aldryn-jobs.svg
Expand Down
2 changes: 0 additions & 2 deletions aldryn_jobs/cms_app.py

This file was deleted.

2 changes: 0 additions & 2 deletions aldryn_jobs/cms_toolbar.py

This file was deleted.

18 changes: 8 additions & 10 deletions aldryn_jobs/cms_wizards.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CreateJobOpeningForm(BaseFormMixin, TranslatableModelForm):
translated fields that we need to access, so, we use TranslatableModelForm
"""

content = forms.CharField(
job_opening_content = forms.CharField(
label="Content", required=False, widget=TextEditorWidget,
help_text=_("Optional. If provided, will be added to the main body of "
"the Opening content."),
Expand All @@ -103,7 +103,7 @@ class Meta:
model = JobOpening
fields = ['title', 'category', 'is_active', 'lead_in',
'publication_start', 'publication_end',
'content', 'can_apply', ]
'job_opening_content', 'can_apply', ]

def __init__(self, **kwargs):
super(CreateJobOpeningForm, self).__init__(**kwargs)
Expand All @@ -119,25 +119,23 @@ def __init__(self, **kwargs):
def save(self, commit=True):
job_opening = super(CreateJobOpeningForm, self).save(commit=False)

# If 'content' field has value, create a TextPlugin with same and add
# If 'job_opening_content' field has value, create a TextPlugin with same and add
# it to the PlaceholderField
content = clean_html(self.cleaned_data.get('content', ''), False)
job_opening_content = clean_html(self.cleaned_data.get('job_opening_content', ''), False)

try:
# CMS >= 3.3.x
content_plugin = get_cms_setting('PAGE_WIZARD_CONTENT_PLUGIN')
except KeyError:
# CMS <= 3.2.x
# COMPAT: CMS3.2
content_plugin = get_cms_setting('WIZARD_CONTENT_PLUGIN')

try:
# CMS >= 3.3.x
content_field = get_cms_setting('PAGE_WIZARD_CONTENT_PLUGIN_BODY')
except KeyError:
# CMS <= 3.2.x
# COMPAT: CMS3.2
content_field = get_cms_setting('WIZARD_CONTENT_PLUGIN_BODY')

if content and permissions.has_plugin_permission(
if job_opening_content and permissions.has_plugin_permission(
self.user, content_plugin, 'add'):

# If the job_opening has not been saved, then there will be no
Expand All @@ -151,7 +149,7 @@ def save(self, commit=True):
'placeholder': job_opening.content,
'plugin_type': content_plugin,
'language': self.language_code,
content_field: content,
content_field: job_opening_content,
}
add_plugin(**plugin_kwargs)

Expand Down
5 changes: 3 additions & 2 deletions aldryn_jobs/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ def save(self, commit=True):
# additional actions while applying for the job
try:
self.send_confirmation_email()
except:
except: # noqa: This is a 3rd-party app, so we don't know for sure which kinds of errors may be raised here
# We're handling ANY exception here because we don't want to
# prevent the form from ultimately getting saved here.
logger.exception('Could not send a confirmation email!')

try:
self.send_staff_notifications()
except:
except: # noqa: This is a 3rd-party app, so we don't know for sure which kinds of errors may be raised here
# We're handling ANY exception here because we don't want to
# prevent the form from ultimately getting saved here.
logger.exception('Could not send a staff notifications!')
Expand Down Expand Up @@ -309,4 +309,5 @@ def clean(self):
class JobCategoriesListPluginForm(AppConfigPluginFormMixin, forms.ModelForm):
model = JobCategoriesPlugin


setup_config(JobsConfigForm, JobsConfig)
11 changes: 2 additions & 9 deletions aldryn_jobs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from django import get_version
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.db.models.signals import pre_delete
Expand Down Expand Up @@ -39,16 +38,10 @@
loose_version = LooseVersion(get_version())


def get_user_model_for_fields():
if loose_version < LooseVersion('1.7.0'):
return get_user_model()
else:
return getattr(settings, 'AUTH_USER_MODEL', 'auth.User')

# We should check if user model is registered, since we're following on that
# relation for EventCoordinator model, if not - register it to
# avoid RegistrationError when registering models that refer to it.
user_model = get_user_model_for_fields()
user_model = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')


def default_jobs_attachment_upload_to(instance, filename):
Expand Down Expand Up @@ -92,7 +85,7 @@ class JobCategory(TranslatedAutoSlugifyMixin,
)

supervisors = models.ManyToManyField(
get_user_model_for_fields(), verbose_name=_('supervisors'),
getattr(settings, 'AUTH_USER_MODEL', 'auth.User'), verbose_name=_('supervisors'),
# FIXME: This is mis-named should be "job_categories"?
related_name='job_opening_categories',
help_text=_('Supervisors will be notified via email when a new '
Expand Down
113 changes: 0 additions & 113 deletions aldryn_jobs/south_migrations/0001_initial.py

This file was deleted.

0 comments on commit 15b36ee

Please sign in to comment.