-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3324bc
commit 57cf772
Showing
11 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.conf import settings as django_settings | ||
from django.utils.functional import LazyObject | ||
|
||
from flag.conf import defaults as flag_settings | ||
|
||
|
||
class LazySettings(LazyObject): | ||
def _setup(self): | ||
self._wrapped = Settings(flag_settings, django_settings) | ||
|
||
|
||
class Settings(object): | ||
def __init__(self, *args): | ||
for item in args: | ||
for attr in dir(item): | ||
if attr == attr.upper(): | ||
setattr(self, attr, getattr(item, attr)) | ||
|
||
|
||
settings = LazySettings() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
# reason displayed when flagging an object | ||
FLAG_REASONS = [ | ||
(1, _("Spam | Exists only to promote a service ")), | ||
(2, _("Abusive | Intended at promoting hatred")), | ||
] | ||
|
||
# number of flags before an object is marked as flagged | ||
FLAG_ALLOWED = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,5 +142,6 @@ | |
EMAIL_PORT = 587 | ||
EMAIL_USE_TLS = True | ||
EMAIL_USE_SSL = False | ||
|
||
# flag app | ||
FLAGS_ALLOWED = 0 | ||
FLAG_ALLOWED = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters