Princeton-CDH / mep-django

Compare e362c1a ... +249 ... e317443

Coverage Reach
mep/accounts/tests/test_accounts_models.py mep/accounts/tests/test_accounts_commands.py mep/accounts/tests/test_twitterbot_100years.py mep/accounts/tests/test_accounts_migrations.py mep/accounts/tests/test_partial_date.py mep/accounts/tests/test_accounts_admin.py mep/accounts/tests/test_accounts_views.py mep/accounts/tests/test_account_templatetags.py mep/accounts/management/commands/twitterbot_100years.py mep/accounts/management/commands/import_figgy_cards.py mep/accounts/management/commands/export_events.py mep/accounts/management/commands/report_timegaps.py mep/accounts/migrations/0034_add_event_footnotes.py mep/accounts/migrations/0025_subevent_item_to_generic.py mep/accounts/migrations/0028_generic_event_partial_dates.py mep/accounts/migrations/0008_flag_duplicate_events.py mep/accounts/migrations/0033_subscription_purchase_date_adjustments.py mep/accounts/migrations/0004_subtype_choices_to_subscription_type_foreignkey.py mep/accounts/migrations/0015_fix_subscription_durations.py mep/accounts/migrations/0012_recalculate_durations.py mep/accounts/migrations/0010_set_reimbursement_end_date_from_start.py mep/accounts/migrations/0001_initial.py mep/accounts/migrations/0022_add_partial_date_purchase.py mep/accounts/migrations/0019_allow_null_precision.py mep/accounts/migrations/0015_borrow_event_rel_item.py mep/accounts/migrations/0021_account_card.py mep/accounts/migrations/0027_address_partial_dates.py mep/accounts/migrations/0029_event_item_to_work.py mep/accounts/migrations/0014_add_address_rel_to_person.py mep/accounts/migrations/0030_event_edition.py mep/accounts/migrations/0003_new_subscription_type_model_foreignkey.py mep/accounts/migrations/0024_event_generic_item.py mep/accounts/migrations/0016_add_borrow_date_precision.py mep/accounts/migrations/0002_field_adjustments_logbook_import.py mep/accounts/migrations/0009_event_ordering_reimbursement_price_to_refund.py mep/accounts/migrations/0011_subscription_duration_to_days.py mep/accounts/migrations/0006_rename_subscribe_and_modification.py mep/accounts/migrations/0032_subscription_add_purchase_date.py mep/accounts/migrations/0018_merge_20180418_1607.py mep/accounts/migrations/0023_optional_price.py mep/accounts/migrations/0007_currency_default_to_franc.py mep/accounts/migrations/0026_rm_subevent_item_rename_generic_item.py mep/accounts/migrations/0017_revise_purchase_from_borrow.py mep/accounts/migrations/0020_convert_bought_to_item_status.py mep/accounts/migrations/0005_remove_subscribe_sub_type.py mep/accounts/migrations/0013_rename_accountaddress_to_address.py mep/accounts/migrations/0031_on_delete.py mep/accounts/migrations/0034_subscription_other_to_separate_deposit.py mep/accounts/migrations/0036_rename_separate_deposit_to_separate_payment.py mep/accounts/migrations/0035_merge_20201210_1240.py mep/accounts/models.py mep/accounts/admin.py mep/accounts/partial_date.py mep/accounts/event_set.py mep/accounts/views.py mep/accounts/templatetags/account_tags.py mep/accounts/templatetags/mep_100years_tags.py mep/accounts/apps.py mep/accounts/urls.py mep/accounts/__init__.py mep/people/tests/test_views.py mep/people/tests/test_models.py mep/people/tests/test_people_signals.py mep/people/tests/test_admin.py mep/people/tests/test_forms.py mep/people/tests/test_geonames.py mep/people/tests/test_people_commands.py mep/people/tests/test_sitemaps.py mep/people/tests/test_people_migrations.py mep/people/views.py mep/people/models.py mep/people/migrations/0016_generate_person_slugs.py mep/people/migrations/0005_people_address_to_account_address.py mep/people/migrations/0007_location_unique_constraints.py mep/people/migrations/0004_rename_address_to_location.py mep/people/migrations/0003_infer_sex_from_title.py mep/people/migrations/0014_library_location.py mep/people/migrations/0001_initial.py mep/people/migrations/0019_pastpersonslug.py mep/people/migrations/0013_rename_sex_to_gender.py mep/people/migrations/0015_add_person_optional_slug.py mep/people/migrations/0002_add_subtype_choices.py mep/people/migrations/0018_on_delete.py mep/people/migrations/0009_allow_negative_years.py mep/people/migrations/0010_merge_20180621_1810.py mep/people/migrations/0006_update_person_locations.py mep/people/migrations/0008_person_is_organization.py mep/people/migrations/0017_person_require_unique_slugs.py mep/people/migrations/0011_person_verified.py mep/people/migrations/0012_add_public_notes.py mep/people/migrations/0009_person_updated_at.py mep/people/migrations/0020_revise_person_notes_slug_metatext.py mep/people/admin.py mep/people/management/commands/export_members.py mep/people/geonames.py mep/people/sitemaps.py mep/people/forms.py mep/people/queryset.py mep/people/apps.py mep/people/urls.py mep/people/__init__.py mep/books/tests/test_books_models.py mep/books/tests/test_books_views.py mep/books/tests/test_books_commands.py mep/books/tests/test_oclc.py mep/books/tests/test_books_migrations.py mep/books/tests/test_books_admin.py mep/books/tests/test_books_signals.py mep/books/tests/test_books_utils.py mep/books/tests/test_books_forms.py mep/books/tests/test_books_queryset.py mep/books/models.py mep/books/migrations/0022_generate_work_slugs.py mep/books/migrations/0018_edition_date_to_partial.py mep/books/migrations/0021_creator_type_order.py mep/books/migrations/0016_group_works_by_uri.py mep/books/migrations/0025_populate_sort_title.py mep/books/migrations/0010_add_initial_formats.py mep/books/migrations/0003_initial_creator_types.py mep/books/migrations/0001_initial.py mep/books/migrations/0002_refactor_item_creators.py mep/books/migrations/0015_split_work_edition.py mep/books/migrations/0017_edition_details.py mep/books/migrations/0009_item_format.py mep/books/migrations/0011_item_multiple_genres.py mep/books/migrations/0014_item_to_work.py mep/books/migrations/0008_add_oclc_item_fields.py mep/books/migrations/0013_item_ebook_url.py mep/books/migrations/0019_edition_remove_year.py mep/books/migrations/0007_item_updated_at.py mep/books/migrations/0006_item_creators.py mep/books/migrations/0020_format_on_delete.py mep/books/migrations/0005_item_mepid_allow_null.py mep/books/migrations/0004_viaf_to_uri.py mep/books/migrations/0026_add_past_work_slug.py mep/books/migrations/0012_add_public_notes.py mep/books/migrations/0023_merge_20200406_1206.py mep/books/migrations/0024_add_work_sort_title.py mep/books/migrations/0021_work_slug_creator_order.py mep/books/views.py mep/books/management/commands/reconcile_oclc.py mep/books/management/commands/export_books.py mep/books/admin.py mep/books/oclc.py mep/books/migration_group_work_utils.py mep/books/utils.py mep/books/forms.py mep/books/sitemaps.py mep/books/queryset.py mep/books/apps.py mep/books/urls.py mep/books/__init__.py mep/common/tests.py mep/common/migrations/0002_update_content_editor_perms_subscriptiontype.py mep/common/migrations/0006_update_content_editor_perms_works_and_djiffy.py mep/common/migrations/0001_content_editor_group.py mep/common/migrations/0007_add_data_viewer_group.py mep/common/migrations/0004_update_content_editor_perms_creatortype.py mep/common/migrations/0003_content_editor_perms_location.py mep/common/migrations/0005_create_script_user.py mep/common/templatetags/mep_tags.py mep/common/views.py mep/common/management/export.py mep/common/forms.py mep/common/models.py mep/common/utils.py mep/common/admin.py mep/common/apps.py mep/common/validators.py mep/common/__init__.py mep/footnotes/tests/test_footnotes_signals.py mep/footnotes/tests/test_footnote_models.py mep/footnotes/tests/test_footnote_views.py mep/footnotes/models.py mep/footnotes/migrations/0005_consolidate_event_footnotes.py mep/footnotes/migrations/0007_rename_pulrbsc.py mep/footnotes/migrations/0001_initial.py mep/footnotes/migrations/0003_add_bibliography_manifest_and_footnote_canvas.py mep/footnotes/migrations/0004_on_delete.py mep/footnotes/migrations/0002_footnote_is_agree_default_true.py mep/footnotes/migrations/0006_alter_footnote_content_type.py mep/footnotes/views.py mep/footnotes/admin.py mep/footnotes/forms.py mep/footnotes/queryset.py mep/footnotes/urls.py mep/footnotes/apps.py mep/footnotes/__init__.py mep/pages/tests/test_pages_models.py mep/pages/tests/test_embed_finders.py mep/pages/tests/test_pages_commands.py mep/pages/tests/test_pages_templates.py mep/pages/tests/test_tags.py mep/pages/models.py mep/pages/migrations/0010_split_person_names.py mep/pages/migrations/0007_essay_landingpage_and_creators.py mep/pages/migrations/0001_initial.py mep/pages/migrations/0003_contentpage_add_featured_image_description.py mep/pages/migrations/0006_add_svg_image_block.py mep/pages/migrations/0009_svg_extended_description.py mep/pages/migrations/0004_landingpage_optional_body.py mep/pages/migrations/0012_alter_body_content_blocks.py mep/pages/migrations/0008_linkable_section_anchor_text.py mep/pages/migrations/0003_image_alt_text.py mep/pages/migrations/0002_homepage_streamfield.py mep/pages/migrations/0011_updated_streamfield_blocks.py mep/pages/migrations/0005_merge_20191010_1625.py mep/pages/management/commands/setup_site_pages.py mep/pages/embed_finders.py mep/pages/wagtail_hooks.py mep/pages/admin.py mep/pages/templatetags/mep_page_tags.py mep/pages/apps.py mep/pages/__init__.py mep/settings.py mep/urls.py mep/dashboard.py mep/__init__.py mep/context_processors.py mep/wsgi.py srcmedia/ts/lib/common.ts srcmedia/ts/lib/form.ts srcmedia/ts/lib/facet.ts srcmedia/ts/lib/input.ts srcmedia/ts/lib/select.ts srcmedia/ts/lib/filter.ts srcmedia/ts/lib/sort.ts srcmedia/ts/lib/output.ts srcmedia/ts/components/ActiveFilters.ts srcmedia/ts/components/PageControls.ts srcmedia/ts/components/StickyControls.ts srcmedia/ts/components/MainMenu.ts manage.py

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 42 of 86 files from the diff.
Other files ignored by Codecov
requirements.txt has changed.
.travis.yml was deleted.
DEPLOYNOTES.rst has changed.
requirements.lock has changed.
package.json has changed.
package-lock.json has changed.
CHANGELOG.rst has changed.
README.rst has changed.

@@ -151,10 +151,10 @@
Loading
151 151
152 152
    def test_error_on_create_non_field(self):
153 153
        # get with no instance should return the descriptor object
154 -
        class TestModel(DateRange):
154 +
        class TestModel2(DateRange):
155 155
            foo_year = AliasIntegerField(db_column='start_year')
156 156
157 -
        assert isinstance(TestModel.foo_year, AliasIntegerField)
157 +
        assert isinstance(TestModel2.foo_year, AliasIntegerField)
158 158
159 159
160 160
class TestVerifyLatLon(TestCase):
@@ -927,6 +927,21 @@
Loading
927 927
        flat_nested = BaseExport.flatten_dict(nested_list)
928 928
        assert flat_nested['page_label'] == '1;2;3'
929 929
930 +
        # list of dict
931 +
        list_of_dict = {
932 +
            'source': [
933 +
                {'type': 'card', 'citation': 'Lending card'},
934 +
                {'type': 'logbook', 'citation': '1923 Logbook', 'image': 'foo'}
935 +
            ]
936 +
        }
937 +
        flat_list = BaseExport.flatten_dict(list_of_dict)
938 +
        assert flat_list['source_type'] == 'card;logbook'
939 +
        assert flat_list['source_citation'] == 'Lending card;1923 Logbook'
940 +
        assert flat_list['source_image'] == ';foo'
941 +
942 +
        # empty list
943 +
        assert BaseExport.flatten_dict({'empty': []}) == {'empty': ''}
944 +
930 945
931 946
@patch('mep.common.management.export.progressbar')
932 947
class TestStreamArray(TestCase):

@@ -54,7 +54,9 @@
Loading
54 54
    'wagtail.documents',
55 55
    'wagtail.images',
56 56
    'wagtail.admin',
57 +
    'wagtail.contrib.legacy.richtext',   # preserve rich-text class behavior after wagtail 2.10
57 58
    'wagtail.core',
59 +
    'wagtail.embeds',
58 60
    'wagtail.contrib.redirects',
59 61
    'taggit',
60 62
    'widget_tweaks',
@@ -182,6 +184,16 @@
Loading
182 184
)
183 185
184 186
187 +
WAGTAILEMBEDS_FINDERS = [
188 +
    {
189 +
        'class': 'wagtail.embeds.finders.oembed'
190 +
    },
191 +
    {
192 +
        'class': 'mep.pages.embed_finders.GlitchHubEmbedFinder'
193 +
    },
194 +
]
195 +
196 +
185 197
# pucas configuration that is not expected to change across deploys
186 198
# and does not reference local server configurations or fields
187 199
PUCAS_LDAP = {
@@ -220,19 +232,21 @@
Loading
220 232
# allow loading js locally, from google (for analytics), and
221 233
# nytimes github (for svg crowbar)
222 234
CSP_SCRIPT_SRC = ("'self'", 'www.googletagmanager.com',
223 -
                  '*.google-analytics.com', 'nytimes.github.io')
235 +
                  '*.google-analytics.com', 'nytimes.github.io',
236 +
                  'unpkg.com', 'd3js.org', 'princeton-cdh.github.io')
224 237
225 238
# allow loading fonts locally only
226 239
CSP_FONT_SRC = ("'self'",)
227 240
228 241
# allow loading css locally & via inline styles
229 -
CSP_STYLE_SRC = ("'self'", "'unsafe-inline'")
242 +
CSP_STYLE_SRC = ("'self'", "'unsafe-inline'", 'unpkg.com')
230 243
231 244
# allow loading web manifest locally only
232 245
CSP_MANIFEST_SRC = ("'self'",)
233 246
234 247
# allow XMLHttpRequest or Fetch requests locally (for search), analytics & maps
235 -
CSP_CONNECT_SRC = ("'self'", '*.google-analytics.com', '*.arcgis.com')
248 +
CSP_CONNECT_SRC = ("'self'", '*.google-analytics.com', '*.arcgis.com',
249 +
                   'princeton-cdh.github.io')
236 250
237 251
# whitelisted image sources - analytics (tracking pixel?), IIIF, maps, etc.
238 252
CSP_IMG_SRC = ("'self'", 'www.googletagmanager.com', '*.google-analytics.com',

@@ -119,7 +119,7 @@
Loading
119 119
        return min_max_ranges
120 120
121 121
    #: name query alias field syntax (type defaults to edismax in solr config)
122 -
    search_name_query = '{!qf=$name_qf pf=$name_pf v=$name_query}'
122 +
    search_name_query = '{!type=edismax qf=$name_qf pf=$name_pf v=$name_query}'
123 123
124 124
    # map form sort to solr sort field
125 125
    solr_sort = {

@@ -1,5 +1,6 @@
Loading
1 1
import datetime
2 2
import logging
3 +
from string import punctuation
3 4
4 5
from django.apps import apps
5 6
from django.contrib.contenttypes.fields import GenericRelation
@@ -670,7 +671,7 @@
Loading
670 671
            # text version of sort name for search and display
671 672
            'sort_name_t': self.sort_name,
672 673
            # sort version of sort name
673 -
            'sort_name_isort': self.sort_name,
674 +
            'sort_name_isort': self.sort_name.lstrip(punctuation),
674 675
            'birth_year_i': self.birth_year,
675 676
            'death_year_i': self.death_year,
676 677
            'has_card_b': self.has_card(),

@@ -1,15 +1,15 @@
Loading
1 -
__version_info__ = (1, 2, 2, None)
1 +
__version_info__ = (1, 6, 0, "dev")
2 2
3 3
4 4
# Dot-connect all but the last. Last is dash-connected if not None.
5 -
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
5 +
__version__ = ".".join([str(i) for i in __version_info__[:-1]])
6 6
if __version_info__[-1] is not None:
7 -
    __version__ += ('-%s' % (__version_info__[-1],))
7 +
    __version__ += "-%s" % (__version_info__[-1],)
8 8
9 9
10 10
# context processor to add version to the template environment
11 11
def context_extras(request):
12 12
    return {
13 13
        # software version
14 -
        'SW_VERSION': __version__
14 +
        "SW_VERSION": __version__
15 15
    }

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 15 files with coverage changes found.

Changes in mep/accounts/migrations/0028_generic_event_partial_dates.py
-12
+12
Loading file...
Changes in mep/accounts/tests/test_accounts_migrations.py
-41
+41
Loading file...
Changes in mep/books/migrations/0021_creator_type_order.py
-2
+2
Loading file...
Changes in mep/common/migrations/0006_update_content_editor_perms_works_and_djiffy.py
-2
+2
Loading file...
New file mep/pages/embed_finders.py
New
Loading file...
New file mep/pages/tests/test_embed_finders.py
New
Loading file...
New file mep/pages/migrations/0012_alter_body_content_blocks.py
New
Loading file...
New file mep/footnotes/migrations/0006_alter_footnote_content_type.py
New
Loading file...
New file mep/accounts/migrations/0035_merge_20201210_1240.py
New
Loading file...
New file mep/footnotes/migrations/0007_rename_pulrbsc.py
New
Loading file...
New file manage.py
New
Loading file...
New file mep/people/migrations/0020_revise_person_notes_slug_metatext.py
New
Loading file...
New file mep/accounts/migrations/0036_rename_separate_deposit_to_separate_payment.py
New
Loading file...
New file mep/accounts/migrations/0034_subscription_other_to_separate_deposit.py
New
Loading file...
New file mep/accounts/migrations/0034_add_event_footnotes.py
New
Loading file...

251 Commits

Hiding 1 contexual commits
+1
-1
-1
+1
+2
+2
-2
-2
Hiding 2 contexual commits
+2
+2
+1
-1
Hiding 1 contexual commits
-1
+1
Hiding 4 contexual commits
Hiding 1 contexual commits
+1
-1
+221 Files
+12099
+11840
+259
Hiding 1 contexual commits
-221 Files
-12099
-11841
-258
+8
+8
-11
-9
-2
+8
+8
+1 Files
+25
+22
+3
+220 Files
+12069
+11812
+257
-220 Files
-12069
-11868
-201
Hiding 1 contexual commits
+56
-56
Hiding 6 contexual commits
-55
+55
Hiding 1 contexual commits
-1
+1
+220 Files
+12069
+11868
+201
-220 Files
-12069
-11868
-201
-1 Files
-10
-10
+1 Files
+10
+10
-1 Files
-10
-10
+56
-56
+221 Files
+12079
+11822
+257
Hiding 1 contexual commits Hiding 1 contexual commits
Hiding 1 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits
-221 Files
-12076
-11875
-201
Hiding 1 contexual commits
+1
-1
Hiding 1 contexual commits
-1
+1
+221 Files
+12076
+11875
+201
Hiding 1 contexual commits
-217 Files
-12052
-11851
-201
Hiding 2 contexual commits
+8
+8
Hiding 1 contexual commits
+1
-1
Hiding 2 contexual commits
+2 Files
+67
+65
+2
-3
-3
+215 Files
+11980
+11780
+200
Hiding 6 contexual commits
-215 Files
-11975
-11775
-200
Hiding 1 contexual commits Hiding 1 contexual commits
-1
+1
Hiding 2 contexual commits
+1
-1
-1
+1
Hiding 1 contexual commits Hiding 1 contexual commits
+215 Files
+11975
+11776
+199
Hiding 2 contexual commits
-215 Files
-11975
-11776
-199
Hiding 37 contexual commits
+1 Files
+69
+56
+13
Hiding 1 contexual commits
Hiding 1 contexual commits
+1
-1
Hiding 2 contexual commits
+2 Files
+93
+91
+2
Hiding 3 contexual commits
-2 Files
-93
-92
-1
Hiding 4 contexual commits
+2 Files
+93
+91
+2
+1 Files
+4
+4
Hiding 1 contexual commits
-1 Files
-223
-221
-2
+1 Files
+223
+221
+2
-1 Files
-84
-82
-2
+49
+61
-12
Hiding 3 contexual commits
+1 Files
+40
+26
+14
+1
+1
+5
+5
-5
-5
Hiding 2 contexual commits
+6
+6
Hiding 1 contexual commits
+1
+1
+11
+12
-1
Hiding 1 contexual commits
-11
-12
+1
Hiding 5 contexual commits
+11
+11
+1
-1
Hiding 1 contexual commits
-1
+1
Hiding 8 contexual commits
+211 Files
+11792
+11602
+190
Hiding 1 contexual commits
-207 Files
-11106
-10925
-181
Hiding 1 contexual commits
+207 Files
+11106
+10925
+181
Files Coverage
mep -0.46% 97.97%
srcmedia/ts 86.55%
manage.py 0.00%
Project Totals (233 files) 97.47%
Loading