This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at creating content flags from some models
- Loading branch information
Madison Scott-Clary
committed
Nov 11, 2016
1 parent
cdf58cf
commit 0289d0b
Showing
24 changed files
with
572 additions
and
132 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
Empty file.
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,19 @@ | ||
from django import template | ||
|
||
from administration.models import Flag | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def can_view_flagged_item(user, flag): | ||
"""A filter for deciding if a user can view a flagged item.""" | ||
if user in flag.participants.all(): | ||
return True | ||
if user.has_perm('administration.can_view_social_flags') and \ | ||
flag.flag_type == Flag.SOCIAL: | ||
return True | ||
if user.has_perm('administration.can_view_content_flags') and \ | ||
flag.flag_type == Flag.CONTENT: | ||
return True | ||
return False |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
GIT_REVNO = 'e92c76811e1796f0ff6818a44405ca4335b95129' | ||
GIT_REVNO = 'cdf58cf04cd17c91fd5d981b43babd72e267764f' | ||
VERSION = 'pre-release' |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,30 +1,46 @@ | ||
appnope==0.1.0 | ||
backports.shutil-get-terminal-size==1.0.0 | ||
beautifulsoup4==4.5.1 | ||
bs4==0.0.1 | ||
configparser==3.5.0 | ||
coverage==4.0.3 | ||
coverage-badge==0.1.2 | ||
decorator==4.0.10 | ||
Django==1.10.3 | ||
django-datetime-widget==0.9.3 | ||
django-extensions==1.7.4 | ||
django-haystack==2.5.1 | ||
django-taggit==0.21.3 | ||
docutils==0.12 | ||
enum34==1.1.6 | ||
flake8==3.0.4 | ||
funcsigs==1.0.2 | ||
ipython==5.1.0 | ||
ipython-genutils==0.1.0 | ||
Markdown==2.6.7 | ||
mccabe==0.5.2 | ||
mock==2.0.0 | ||
pathlib2==2.1.0 | ||
pbr==1.10.0 | ||
pexpect==4.2.1 | ||
pickleshare==0.7.4 | ||
Pillow==3.4.1 | ||
prompt-toolkit==1.0.9 | ||
prose-wc==0.3.1 | ||
ptyprocess==0.5.1 | ||
pycodestyle==2.0.0 | ||
pyflakes==1.2.3 | ||
Pygments==2.1.3 | ||
pygraphviz==1.3.1 | ||
pymdown-extensions==1.1 | ||
pypandoc==1.3.3 | ||
python-coveralls==2.9.0 | ||
pytz==2016.7 | ||
PyYAML==3.12 | ||
requests==2.11.1 | ||
simplegeneric==0.8.1 | ||
six==1.10.0 | ||
tblib==1.3.0 | ||
traitlets==4.3.1 | ||
wcwidth==0.1.7 | ||
Werkzeug==0.11.11 |
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
Oops, something went wrong.