Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves constants to settings.py; #993 #1079

Closed
wants to merge 36 commits into from
Closed

Moves constants to settings.py; #993 #1079

wants to merge 36 commits into from

Conversation

Carson-Tang
Copy link
Member

Fixes #993

Copy link
Member

@quantum5 quantum5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also merge master or rebase on master to get linter.

@@ -312,7 +391,7 @@
ENABLE_FTS = False

# Bridged configuration
BRIDGED_JUDGE_ADDRESS = [('localhost', 9999)]
BRIDGED_JUDGE_ADDRESS = [('localhost', 8080)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.

@@ -9,7 +9,7 @@
from django.forms.utils import flatatt
from django.utils.safestring import mark_safe

ACE_URL = getattr(settings, 'ACE_URL', '//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ext-split.js')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can inline this now.

@@ -6,8 +6,8 @@
from judge.models import Submission
from judge.timezone import from_database_time

PP_STEP = getattr(settings, 'DMOJ_PP_STEP', 0.95)
PP_ENTRIES = getattr(settings, 'DMOJ_PP_ENTRIES', 100)
PP_STEP = settings.DMOJ_PP_STEP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline these.

excluded=getattr(settings, 'DMOJ_CAMO_EXCLUDE', ()),
https=getattr(settings, 'DMOJ_CAMO_HTTPS', False))
if settings.DMOJ_CAMO_URL and settings.DMOJ_CAMO_KEY:
client = CamoClient(settings.DMOJ_CAMO_URL, key = settings.DMOJ_CAMO_KEY,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces before/after =.

@@ -5,4 +5,4 @@
else:
Subscription = None

newsletter_id = None if Subscription is None else getattr(settings, 'NEWSLETTER_ID_ON_REGISTER', None)
newsletter_id = None if Subscription is None else settings.NEWSLETTER_ID_ON_REGISTER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename with DMOJ_ prefix.

'django_select2.js'),
css={'screen': (getattr(settings, 'SELECT2_CSS_URL', DEFAULT_SELECT2_CSS),)}
css={'screen': (settings.SELECT2_CSS_URL)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was a tuple; this no longer is.

TERMS_OF_SERVICE_URL = None
DEFAULT_USER_LANGUAGE = 'PY2'

COMPRESS_ENABLED = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this should still be not DEBUG.

SITE_ADMIN_EMAIL = False

# Constants
DMOJ_SSL = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carson-Tang Carson-Tang closed this Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move constants to settings.py
6 participants