Commit Graph

46 Commits

Author SHA1 Message Date
Jawayria
ebc6044c10 BOM-2028: Removed unused imports from common/djangoapps/{course_modes, edxmako, entitlements} 2021-02-23 19:30:09 +05:00
usamasadiq
515458b9dc Applied pylint-amnesty 2021-02-02 17:59:20 +05:00
Ned Batchelder
21d7e6f3b2 Use https for open.edx.org 2020-11-02 11:29:03 -05:00
Tim McCormack
f29e418264 Revert "Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)" (#25055)
This reverts commit 986a448d9e.
2020-09-28 13:53:57 +00:00
Ahtisham Shahid
986a448d9e Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)
This reverts commit ba9ee4e151.

Fixed Style lint issue
2020-09-21 13:48:00 +05:00
Tim McCormack
ba9ee4e151 ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
2020-09-18 13:33:50 +00:00
Feanil Patel
4ac2c5e92b Correct logic on building marketing links.
The logic used to has a special case for edge in the hostname which
didn't really make sense. So instead we just check to see if the given
url starts with http and if it does we return it directly.  If it doesn't,
then we try to convert it to a valid url and return that.  If that fails
we return .

Add a new custom metric `unresolved_marketing_link` to track when we
run into this scenario.
2020-07-09 15:09:38 -04:00
Feanil Patel
b6fdad2ea4 If this reverse failed, it was throwing a 500.
Catch the 500 in this case and throw a 404 instead.
2020-07-08 15:56:53 -04:00
Giovanni Cimolin da Silva
6305fbdfb6 Add mktg links override capability
This commit adds a feature that allows overriding any marketing URL, either by configuration on lms.env.json or SiteConfiguration, regardless if a marketing website is set up.
The links can be set by passing MKTG_URL_OVERRIDES to either `lms.env.json` or `SiteConfiguration`.
2020-02-25 13:51:58 -03:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
uzairr
c545ed8bbe Update privacy and TOS links for edge.
Currently,edge environment is serving empty pages against privacy
and TOS.Now, this behaviour is modified by pointing those links to
edX's privacy and TOS pages.

PROD-1066
2019-12-13 17:39:03 +05:00
Diana Huang
bf7dad15e4 Remove microsite djangoapp except migrations and configuration. 2019-08-16 09:42:57 -04:00
Chris Pappas
d937708432 Merge pull request #20438 from edx/cpappas/ENT-1887
ENT-1887 | Adding logic for new business marketing footer url constru…
2019-05-10 16:28:27 -04:00
Christopher Pappas
4c5ca6d086 ENT-1887 | Adding logic for new business marketing footer url construction, while maintaining backwards compatibility
Fixing quality test

Testsing out a default value for the sake of jenkins tests. will revert

Fix footer test from being flaky

Moving an import statement

ran isort. adding a test. fixing 1 quality issue

Quality cleanups

Attempting more quality fixes

adding back in config variable name for default value

Adding ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS to common settings

Changing marketing_url logic to only concatenate enterprise url to root if the enterprise url is relative (starts with a /)

quality fixes
2019-05-09 17:15:47 -04:00
Amit
328bcbe047 INCR-135: Run python-modernize on common/djangoapps/edxmako (#20483) 2019-05-09 10:08:57 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Jeremy Bowman
fdc50c3aa8 PLAT-1419 Make edxmako a proper template backend 2017-12-01 17:01:52 -05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Douglas Hall
8f6182aabf Allow for site override of MKTG_URLS setting in index view 2016-09-22 15:58:27 -04:00
Saleem Latif
8ae92901ef 1. Merge microsites into Comprehensive Theming
2. Add site configuration overrides to theming/helpers.py
3. Move microsite.get_value from theming/helpers to site_configuration/helpers
4. Move microsite_configuration.microsite.get_value usages to site_configuration.helpers.values
2016-07-27 13:55:14 +05:00
Matt Drayer
68312bdd2d Revert "Revert "saleem-latif/WL-328: Multi-Site Comprehensive Theming""
2. Update COMPREHNSIVE_THEME_DIR to COMPREHENSIVE_THEME_DIRS
3. Update paver commands to support multi theme dirs
4. Updating template loaders
5. Add ENABLE_COMPREHENSIVE_THEMING flag to enable or disable theming via settings
6. Update tests
7. Add backward compatibility for COMPREHEHNSIVE_THEME_DIR
2016-06-30 15:19:51 +05:00
Calen Pennington
93970f3473 Allow edxmako to be passed an explicit request to create the RequestContext from 2016-06-08 16:35:25 -04:00
Calen Pennington
25c4398125 Convert edxmako to use django_crum to get the current request 2016-06-08 16:35:24 -04:00
David Ormsbee
13682e4694 Cache edxmako request context computation.
When capa problem rendering was moved to happen inline on courseware
page loads, we started executing many more Mako templates on sequences
with large numbers of thse problems. To help offset this, we're caching
the context generation (it showed up as the easiest piece of low
hanging fruit on profiles of the courseware index page).

[PERF-261]
2016-02-26 16:15:07 -05:00
Zia Fazal
c0648ab164 moved IS_EDX_DOMAIN dependent feature to edx.org theme 2016-01-22 15:32:19 -05:00
Hasnain
c14f65a293 Added site_map in static template
Allow file extensions in MKTG_URL_LINK_MAP template keys
Set content type on requests for static templates based on the template key
2016-01-14 13:44:54 -05:00
Dan Powell
31646e4a72 Don't render unconfigured marketing links in CMS footer. 2015-12-03 13:41:53 -05:00
jsa
41b0b793de reduce log severity when building marketing links 2015-07-10 16:21:12 -04:00
Calen Pennington
cbcb0ee8ab Teach edx-mako to force csrf_tokens to unicode (from smart_strings) 2015-02-27 13:38:16 -05:00
Andy Armstrong
4d75c18098 Fix Mako templates to use latest request context
Fixed the edX middleware to lazily create request
context for Mako templates, so that it is based on
any changes made to the request object.

Verified that with this fix the "Instructor" tab is
correctly hidden when a staff member is viewing
the course as a student.
2014-12-09 23:38:31 -05:00
stv
cf9308144d Fix PEP8: E302 expected 2 blank lines, found 1 2014-11-10 11:00:11 -08:00
stephensanchez
c15d97ea9b Removing the feature flags for new header and footer.
Fix acceptance tests

Updating lettuce tests.

Revert the deletion of the original edx header and footer.

Renaming old header and footers to legacy files.

Add IS_EDX_DOMAIN flag for header.

Updating tests and django main template.

renaming the header files for microsite backwards compat.
2014-10-14 17:47:46 +00:00
Chris Dodge
8e1d0f7f23 For microsites, since we don't have a footer override yet for django templates, remove the footer all together 2014-09-17 10:52:04 -04:00
Stephen Sanchez
75d6f99fed The main django template needs header and footer feature flags. 2014-09-02 12:08:22 +00:00
Jesse Zoldak
96153ceed0 Revert "The main django template needs header and footer feature flags." 2014-08-29 16:43:30 -04:00
Stephen Sanchez
20a66ee2ef The main django template needs header and footer feature flags. 2014-08-29 15:38:28 +00:00
Waheed Ahmed
d9ccaa650a Check REQUEST_CONTEXT.context exists before accessing it.
LMS-11226
2014-08-14 12:21:54 -04:00
Waheed Ahmed
05b87fd99b Implemented process_response method to clear requestcontext global variable in mako middleware.
LMS-6622
2014-08-06 19:58:20 +05:00
Chris Dodge
aa43689a93 This PR addresses the open feedback on the Microsites feature 2014-02-28 16:27:12 -05:00
Chris Rossi
0a1ed11daa Make mako template lookups pluggable.
This code adds the ability to add Mako template lookup directories on
the fly, allowing third party add-ons to contribute their own Mako templates.
A new API function for registering Mako templates is introduced::

    from edxmako import add_lookup

    add_lookup('main', '/path/to/templates')

    # Or, specify a package to lookup using pkg_resources.  This will
    # add the 'templates' directory inside the current package:
    add_lookup('main', 'templates', package=__name__)
2014-01-31 13:55:36 -05:00
Chris Dodge
c9718380ea catch additional FEATURE['ENABLE_MKTG_SITE'] checks and make sure MicrositeConfigurations will override the global setting
one more faulty login regarding ENABLE_MKTG_SITE=true situations
2014-01-16 17:04:17 -05:00
Chris Dodge
a3211a7405 Introduction of the Microsite feature which allows for limited multi-tenant branding on a subdomain basis, e.g. foo.edx.org and bar.edx.org
fix errorenous logic when running a microsite that could reside in a hosting environment with a marketing site in front of it

pep8/pylint fixes

address PR feedback, remove underscore from test hostname

more pep8/pylint cleanup. Skip test_microsites test, it works on localdev, not on Jenkins. Need to talk with QA team

manually add Ned's single-to-double quote fix

change aws.py runtimes so that the microsite_dir that is read from configuration is changed to a python path

Conflicts:
	lms/templates/help_modal.html
2014-01-14 14:36:01 -05:00
David Baumgold
b32f2bc170 MITX_ROOT_URL => EDX_ROOT_URL 2013-12-04 12:59:35 -05:00
David Baumgold
f3f4af8087 settings.MITX_FEATURES => settings.FEATURES 2013-12-03 15:34:55 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00