Commit Graph

43 Commits

Author SHA1 Message Date
Kfir Hadas 87dd95f1e0 Refactor into an app factory [2 of 2] (#322)
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
TheAMM 1dae331156 Completely handle qBittorrent webseeds
Fixes #319

Zero webseeds: empty bytestring
One webseed: bytestring
More than one: a list of bytestrings (as the spec asks for!)
2017-07-30 11:49:13 +03:00
TheAMM 987103b213 Handle qButtorrent empty url-list/webseeds
url-list is supposed to be omitted in case of no webseeds,
but qB will instead use an empty bytestring '' as the value.
This commit makes the validation more lenient regarding url-list.
2017-07-30 11:36:38 +03:00
Anna-Maria Meriniemi 1bc36c5a17 [Schema change] Add webseed support (BEP-19) (#317)
Store webseeds in Trackers table with is_webseed flag
Adjusts torrent creation accordingly
2017-07-30 00:00:39 +03:00
Kfir Hadas b992467dad Apply isort & flake8 (#312)
* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
2017-07-28 20:01:19 +03:00
mreweilk dd8cb4757e Admin Log 2.0 (#283)
* Admin log added

* Add admin log to top bar

* Fixed some admin log bugs

* Remove comment_id column because comments die when they are killed

* Fix tabs in admin log template

* Fixed sort of admin logs to be created_time desc

* Fix navbar wrapping to a new line

when 992px <= width <= 1200px

* Put reports and admin log in "Admin" dropdown

Applied ./lint.sh fixes

Fixed long lines

* Updated log to be text instead of id based to account for future deletions

* Small fix in log message formatting
2017-07-04 23:13:59 -05:00
TheAMM 081eb16246 Make username regex to stop the validation chain
with a decorator to replace ValidationError with StopValidation
2017-06-19 16:05:42 +03:00
TheAMM 505b4e18bd Move to markdown-it, render markdown in DOMContentLoaded
No more separate <script>s for comments
Adds a link to a GFM cheatsheet on markdown form
Spaces to tabs on "markdownEditors" DOMContentLoaded
2017-06-01 06:28:38 -05:00
nyaazi bea63315cd Merge branch 'master' into reports 2017-05-29 16:20:48 +03:00
TheAMM d89f74893b Remove username validator from login form to allow logging in with email
Since our previous regex was broken, the validator passed practically everything.
2017-05-26 23:28:28 +03:00
nyaazi 9e656ff7f6 Line too long 2017-05-26 15:29:49 +03:00
nyaazi 5332ba1a49 Merge branch 'master' into reports 2017-05-26 15:25:02 +03:00
TheAMM b6ecad898d Fix username validator
Tehee, oops!
2017-05-26 01:47:05 +03:00
nyaadev b7144f80f9 Make comments great again. 2017-05-22 23:38:06 +02:00
nyaadev fee55c1792 comments can be added+removed. gravatar for user avatar 2017-05-22 23:20:49 +02:00
Sn0wCrack fe6abf33c1 Added ability for users to leave anonymous comments 2017-05-22 23:19:36 +02:00
Sn0wCrack 6d608ab2f4 Added comments 2017-05-22 23:19:23 +02:00
katnyaa 159d5a5d9e Fix lint errors 2017-05-22 15:12:17 +01:00
TheAMM a1c024a342 Re-enable CSRF token for upload & fix API CSRF handling 2017-05-22 16:29:14 +03:00
aldacron c2438f3913 nyaadev is an idiot and broke apiv2 2017-05-21 22:10:05 -07:00
nyaadev a4c7dd7912 Add ReCaptcha to upload page if user is not logged in.
Bring back CSRF to upload form (Use the upload API)
2017-05-21 19:29:21 +02:00
nyaadev 9af778217b DB CHANGE: Add uploader ip address to torrent column and show on torrent view page for superadmins.
Added migration script!: remove sukebei_ lines if your local db does not have those.
Show users ip address on user page for superadmins.
Rename Admin to Moderator internally.
Moderators can now change user level to trusted.
Superadmins can make users moderator.
Improve changing user level.
2017-05-21 19:12:15 +02:00
nyaazi 92a6074fa2 Merge branch 'master' into reports 2017-05-21 18:48:45 +03:00
TheAMM b9d88e8960 Restructure upload.html and edit.html as well as route logic
Rename variables and reformats user/admin logic
Add an is_trusted field to upload and edit forms

Restructure fields on upload and edit pages
Add simple styling for checkboxes
Add titles (mouseover) for checkboxes with crude explanations
Show Anonymous checkbox during upload and check & disable it for guests
Show Trusted checkbox for users at or above Trusted level
Adjust description field rendering to show field label above it

Add title (mouseover) for edit icon on torrent page
Show uploader for admins on anonymous torrents
Show uploader for admins when editing others' torrents
2017-05-20 22:00:45 +03:00
nyaazi ec0f8000d7 Usage of WTForms for report action 2017-05-20 14:23:29 +03:00
nyaazi 354736720b Implemented report action
Actions: Close report, Hide torrent, Delete torrent
2017-05-20 13:33:58 +03:00
TheAMM 4b4a7b9830 Support BitComet empty directories (ew)
This will allow most (if not all) torrents that have been rejected by 'Malformed torrent metadata (path part is empty)'

Adjusts _validate_bytes to disable empty check
Adds the empty check to file tree parsing
2017-05-20 10:12:32 +03:00
nyaazi 98fbe6efb1 Adding report table, route and view. 2017-05-19 20:03:47 +03:00
nyaadev 2a1f8fab87 pep8 2017-05-19 14:36:33 +02:00
A nyaa developer d936fcf09d Merge pull request #59 from jprandomdev/deprecated_forms
replaced deprecated Classes by their newer versions
2017-05-18 15:20:40 +02:00
tipuch 6765929c7d - replaced deprecated fields by their newer counterparts. 2017-05-17 22:23:36 -04:00
martstern 931b2b0b83 added user class display and editing 2017-05-17 06:02:15 -04:00
Johnny Ding ad17558ec3 Merge pull request #53 from sharkykh/pep8
Fix PEP8 errors and warnings
2017-05-17 00:08:42 -07:00
UnKnoWn 1f63cdea0a Update forms.py 2017-05-17 05:40:30 +08:00
UnKnoWn 6792716903 Current password required for all profile action
Current password is required for all actions on profile (email change, password change, any to be added later, etc...)
2017-05-17 05:13:55 +08:00
sharkykh 9ac56ba3d7 AutoPEP8 2017-05-16 12:43:55 +03:00
sharkykh 60b7029fcc Remove merge conflict indicators 2017-05-16 12:43:33 +03:00
sharkykh 5e60847cb6 More E501 line too long - multiple files
nyaa/backend.py:75
nyaa/forms.py:129,175
nyaa/models.py:88
2017-05-16 12:43:33 +03:00
sharkykh a79c0f8a93 PEP8 (a run of lint.sh) 2017-05-16 12:42:12 +03:00
martstern eb59116429 allow admin to give trusted to users. show users their own info when logged in 2017-05-15 07:49:25 -04:00
TheAMM c1df153e98 Don't enforce site tracker as first, just that it exists on the torrent
Fixes issue #42
Also adds logic for private torrents requiring site tracker as the main tracker (otherwise there's no point on uploading them on the site)
Changes upload.html wording to reflect the requirement to have the tracker, not necessarily as the first one.
2017-05-14 14:22:17 +03:00
nyaadev 064c33ecf4 Fix cookies messing with cache
Change Display name to Torrent display name for clarity
2017-05-13 19:26:43 +02:00
nyaadev 00d65e312c Initial commit. 2017-05-12 20:51:49 +02:00