Skip to content

Commit

Permalink
remove extraadminfilters, update email footer logo (#1558)
Browse files Browse the repository at this point in the history
* remove extraadminfilters, update email footer logo

* ⚡ speed up errata admin
  • Loading branch information
mwvolo authored Apr 23, 2024
1 parent 95d990a commit 6865e05
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 93 deletions.
9 changes: 5 additions & 4 deletions errata/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from django.http import HttpResponse
from django.utils.encoding import smart_str
from django.utils.html import mark_safe

from extraadminfilters.filters import UnionFieldListFilter
from rangefilter.filters import DateRangeFilter

from reversion.admin import VersionAdmin
Expand Down Expand Up @@ -56,6 +54,9 @@ class BlockedUserAdmin(admin.ModelAdmin):
list_display = ('account_id', 'fullname', 'reason',)

class ErrataAdmin(ImportExportActionModelAdmin, VersionAdmin):
def get_queryset(self, request):
return super(ErrataAdmin, self).get_queryset(request).prefetch_related('book')

class Media:
js = (
'//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', # jquery
Expand Down Expand Up @@ -166,13 +167,13 @@ def changelist_view(self, request, extra_context=None):
if request.user.is_superuser or request.user.groups.filter(name__in=['Content Managers']).exists():
self.list_display = ['id', 'book_title', 'created', 'modified', 'short_detail', 'number_of_errors', 'status', 'error_type', 'resource', 'location', 'additional_location_information', 'resolution', 'archived', 'junk'] # list of fields to show if user is in Content Manager group or is a superuser
self.list_display_links = ['book_title']
self.list_filter = (('created', DateRangeFilter), ('modified', DateRangeFilter), ('book', UnionFieldListFilter), 'status', 'created', 'modified', 'is_assessment_errata', 'modified', 'error_type', 'resolution', 'archived', 'junk', 'resource')
self.list_filter = (('created', DateRangeFilter), ('modified', DateRangeFilter), 'book', 'status', 'created', 'modified', 'is_assessment_errata', 'modified', 'error_type', 'resolution', 'archived', 'junk', 'resource')
self.editable = ['resolution']

else:
self.list_display = ['id', 'book_title', 'created', 'short_detail', 'status', 'error_type', 'resource', 'location', 'created', 'archived'] # list of fields to show otherwise
self.list_display_links = ['book_title']
self.list_filter = (('created', DateRangeFilter), ('modified', DateRangeFilter), ('book', UnionFieldListFilter), 'status', 'created', 'modified', 'is_assessment_errata', 'error_type', 'resolution', 'archived', 'resource')
self.list_filter = (('created', DateRangeFilter), ('modified', DateRangeFilter), 'book', 'status', 'created', 'modified', 'is_assessment_errata', 'error_type', 'resolution', 'archived', 'resource')
return super(ErrataAdmin, self).changelist_view(request, extra_context)

@method_decorator(csrf_protect)
Expand Down
2 changes: 1 addition & 1 deletion errata/templates/templates/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h4 style="line-height: 21px; font-family: Helvetica, Arial, sans-serif; font-si

<p style="font-size: 14px; color: #9A9A9B">OpenStax&nbsp;&nbsp;6100 Main St&nbsp;&nbsp;MS-375&nbsp;&nbsp;Houston&nbsp;&nbsp;Texas&nbsp;&nbsp;77005</p>

<div><a href="http://www.rice.edu/" style="padding: 30px 0; display: block;" target="_blank"><img alt="logo-rice" border="0" class="logo-rice" id="ba3a7381-e418-447c-85ba-067adcf9565d" src="http://image.openstaxcommunication.org/lib/fe9713727766027974/m/1/logo-rice.png" style="outline: 0px; border: none;" title="logo-rice" width="60"> </a></div>
<div><a href="http://www.rice.edu/" style="padding: 30px 0; display: block;" target="_blank"><img alt="logo-rice" border="0" class="logo-rice" id="ba3a7381-e418-447c-85ba-067adcf9565d" src="https://assets.openstax.org/oscms-prodcms/media/original_images/rice-logo.png" style="outline: 0px; border: none;" title="logo-rice" width="60"> </a></div>
</td>
</tr>
<!-- END FOOTER -->
Expand Down
Empty file removed extraadminfilters/__init__.py
Empty file.
74 changes: 0 additions & 74 deletions extraadminfilters/filters.py

This file was deleted.

12 changes: 0 additions & 12 deletions extraadminfilters/tests.py

This file was deleted.

5 changes: 4 additions & 1 deletion openstax/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
# Amazon SES mail settings
DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL', '[email protected]')
SERVER_EMAIL = os.getenv('SERVER_EMAIL', '[email protected]')
AWS_SES_FROM_EMAIL = '[email protected]'
USE_SES_V2 = True
AWS_SES_REGION_NAME = os.getenv('AWS_SES_REGION_NAME', 'us-west-2')
AWS_SES_REGION_ENDPOINT = os.getenv('AWS_SES_REGION_ENDPOINT', 'email.us-west-2.amazonaws.com')
# Default to dummy email backend. Configure dev/production/local backend
Expand Down Expand Up @@ -225,7 +227,6 @@
'mail',
'global_settings',
'errata',
'extraadminfilters',
'redirects',
'oxauth',
'webinars',
Expand Down Expand Up @@ -354,6 +355,8 @@
APPLICATION_DOMAIN = 'openstax.org'
elif ENVIRONMENT == 'test':
APPLICATION_DOMAIN = 'dev.openstax.org'
elif ENVIRONMENT == 'local':
APPLICATION_DOMAIN = 'dev.openstax.org'
else:
APPLICATION_DOMAIN = f'{ENVIRONMENT}.openstax.org'
BASE_URL = f'https://{APPLICATION_DOMAIN}'
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ django-modelcluster==6.2.1
django-openstax-accounts
django-openstax-healthcheck
django-rest-auth==0.9.5
django-reversion==5.0.0
django-reversion==5.0.12
django-ses==3.5.2
django-storages==1.12.3
django-taggit>=4.0.0
Expand Down

0 comments on commit 6865e05

Please sign in to comment.