Compare commits

...

2360 Commits

Author SHA1 Message Date
hecfernandez 120442206b fix tags exclude filter behaviour (#1246)
* fix tags exclude filter behaviour
2019-02-13 14:20:04 +01:00
Álex Hermida d6d3f8c6a8 Update change log 2019-02-01 21:54:16 +01:00
Miguel Gonzalez 3cebad87eb fix: Sanitize email header removing linefeed and carriage return chars 2019-01-29 13:45:23 +01:00
Álex Hermida f45f5ae08a Activate Ukrainian language 2019-01-29 13:15:19 +01:00
Álex Hermida 0434e8b78b Fix calculate_milestone_is_closed and add tests 2019-01-29 10:30:59 +01:00
Héctor Fernández Cascallar 0c0e09819a refactor concatenation method for keep compatibility 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 2b38fefa13 refactor exclude filter mode implementation 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 7c5ba16d24 refactor prepare filter methods in tags filter 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar b0d065167c refactor tags exclude filter implementation 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 4bb12d73d9 fix membership query for avoid project-role without users 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar e736846562 code refactor 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 2bdd652ea7 remove pytest development mark 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 483d3ffd5f add tests for task filters 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 2d77f8974b add exclude mode for user stories filter 2019-01-22 11:29:20 +01:00
Héctor Fernández Cascallar 77fa09a953 add exclude mode for issues filters 2019-01-22 11:29:20 +01:00
Álex Hermida df9830bb4f Update change log 2019-01-14 13:48:44 +01:00
Álex Hermida 849ce97a1c Update messages catalog 2019-01-14 13:25:24 +01:00
Álex Hermida c260a4dd22 Upgrade calculate milestone is closed 2019-01-11 13:24:48 +01:00
Álex Hermida 5f301450df Modify create task factory 2019-01-03 22:13:49 +01:00
Álex Hermida abf2b11220 Refactor and fix tests 2019-01-03 22:13:49 +01:00
Álex Hermida a4256c3f09 Add issue milestones signals 2019-01-03 22:13:49 +01:00
Álex Hermida 18e97be27c Add move issues to sprint test & endpoint 2019-01-03 22:13:49 +01:00
Álex Hermida a17ed83755 Move tasks to another sprint 2019-01-03 22:13:49 +01:00
Álex Hermida fe4cddac30 Test move and close oprevious sprint 2019-01-03 22:13:49 +01:00
Álex Hermida 0cb423c929 Change approach move us's from sprint to another 2019-01-03 22:13:49 +01:00
Álex Hermida 39e9de71cf Add milestones bulk items 2019-01-03 22:13:49 +01:00
Álex Hermida 4c74e6182f Add test test_api_update_milestone_in_bulk_userstories 2019-01-03 22:13:49 +01:00
Álex Hermida dae83618a1 Update change log 2018-12-10 19:36:53 +01:00
Miguel Gonzalez 97b69cdb61 Add extra requirements for oauthlib
See https://oauthlib.readthedocs.io/en/latest/faq.html?highlight=signedtoken#oauth-2-serviceapplicationclient-and-oauth-1-with-rsa-sha1-signatures-say-could-not-import-jwt-what-should-i-do
2018-12-10 10:49:58 +01:00
Álex Hermida a5386cb79c Update change log 2018-12-03 21:41:03 +01:00
Álex Hermida 6a0a55f982 Update messages catalog 2018-12-03 21:40:15 +01:00
Miguel Gonzalez 2d91b75096 Update changelog 2018-11-28 08:34:56 +01:00
Álex Hermida 0e1105fb2b Check permissions on webnotifications list 2018-11-28 08:32:33 +01:00
Álex Hermida 49520bcc9b Update change log 2018-11-27 18:27:15 +01:00
Álex Hermida 3cd0da80d5 Update messages catalog 2018-11-27 18:09:47 +01:00
Álex Hermida 4fa4c02d16 Add my_homepage attr to projects list 2018-11-27 18:03:50 +01:00
Daniel García 809a90b777 Added custom fields dropdown, checkbox and number 2018-11-27 18:03:50 +01:00
Álex Hermida 305b8f048f Add tests update invalid milestone in bulk 2018-11-27 18:03:50 +01:00
Álex Hermida ad757f233b Add update issue milestone in bulk 2018-11-27 18:03:50 +01:00
Álex Hermida 8806fce1eb Add test update issue milestone in bulk 2018-11-27 18:03:50 +01:00
Álex Hermida 7d8073f801 Add update tasks milestone in bulk 2018-11-27 18:03:50 +01:00
Álex Hermida 90a12ee95a Add test update tasks milestone in bulk 2018-11-27 18:03:50 +01:00
Álex Hermida 10b5baefbb Add user story bulk update milestone test 2018-11-27 18:03:50 +01:00
Álex Hermida 80002086d5 Fixe timeline query 2018-11-27 18:03:50 +01:00
Daniel García 9b70d25f49 Enable filtering by project in UserProjectSettingsViewSet 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 8e4d1a5653 Pin kombu version to match celery
See https://github.com/celery/kombu/issues/873
2018-11-27 18:03:50 +01:00
Daniel García a35db80932 Set project on top on user projects list 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 533d72fee6 Remove unused file 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 117fc011f7 Update compatibility to python3.5+ 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 963763be31 Adapt test to new bleach version behaviour 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 22eae180c6 Remove md_globals argument
See https://python-markdown.github.io/change_log/release-3.0/#md_globals-keyword-deprecated-from-extension-api
2018-11-27 18:03:50 +01:00
Miguel Gonzalez 6842a7bb21 Configure tox 2018-11-27 18:03:50 +01:00
Miguel Gonzalez 03bf1f0a9a Adjust config 2018-11-27 18:03:50 +01:00
Miguel Gonzalez cb24850466 Update requirements and use pipenv to manage them 2018-11-27 18:03:50 +01:00
Álex Hermida 203e37d98b add attachment new filter to only relevant timeline 2018-11-27 18:03:50 +01:00
Daniel García b47a4d5dad Enable activity pagination 2018-11-27 18:03:50 +01:00
Daniel García 9fd40ce1bc Set default permissions for anon user when importing from Trello 2018-11-27 18:03:50 +01:00
Daniel García 08e31a2ca9 Web notifications 2018-11-27 18:03:50 +01:00
Álex Hermida 4fe58359f4 Refactor tests 2018-11-27 18:03:50 +01:00
Álex Hermida 4b5e58f806 Refactor migrations 2018-11-27 18:03:50 +01:00
Álex Hermida 81ff7fd666 remove extra sections 2018-11-27 18:03:50 +01:00
Álex Hermida fc9af7d1df Remove meetup from homepage section 2018-11-27 18:03:50 +01:00
Álex Hermida 54fe5ba79c Validate user settings homepage 2018-11-27 18:03:50 +01:00
Álex Hermida 5ac2cf6146 Add allowed sections to project settings serializer 2018-11-27 18:03:50 +01:00
Álex Hermida 2d7229e494 Add homepage allowed sections 2018-11-27 18:03:50 +01:00
Álex Hermida f188974f31 Add project settings tests 2018-11-27 18:03:50 +01:00
Álex Hermida 0512b1a47d Add migrations 2018-11-27 18:03:50 +01:00
Daniel García 9389b65157 User settings by project 2018-11-27 18:03:50 +01:00
Álex Hermida 8bfdf596dc Update change log 2018-10-14 19:34:00 +02:00
Álex Hermida 8fbe0c78d5 Update messages catalog 2018-10-14 19:32:03 +02:00
Álex Hermida 09f8ada4c2 Refactor remove webhooks logs 2018-10-14 19:20:56 +02:00
Álex Hermida 9aaf45c725 Update po files 2018-10-14 19:20:56 +02:00
Álex Hermida e37eb65431 Add webhook block private setting 2018-10-14 19:20:56 +02:00
Álex Hermida 8b130f0361 Refactor old tests 2018-10-14 19:20:56 +02:00
Álex Hermida 39f3f82970 Add tests 2018-10-14 19:20:56 +02:00
Álex Hermida 178ab9ec43 Prevent local webhook requests 2018-10-14 19:20:56 +02:00
Álex Hermida 221211e716 Add url validation 2018-10-14 19:20:56 +02:00
Álex Hermida 1a850f5179 Update change log 2018-09-19 12:50:46 +02:00
Álex Hermida 34c5bd40d3 Save thumbnail file path in timeline and use it in serializer 2018-09-19 12:13:38 +02:00
Álex Hermida d55ee21e8e Remove thumb_url in history attachment freeze data 2018-09-19 12:13:38 +02:00
Álex Hermida ef8f44e434 Refactor thumb_url in timeline serializer 2018-09-19 12:13:38 +02:00
Álex Hermida c40cb86dbd Refactor get_thumbnail_url 2018-09-19 12:13:38 +02:00
Daniel García e7884e417e Enable ordering us tasks list by us_order 2018-09-19 09:25:47 +02:00
Miguel Gonzalez a19bec8ccd Fix non existing key case 2018-09-19 07:23:00 +02:00
Álex Hermida 2d8a18968b Update change log 2018-09-18 17:19:57 +02:00
Álex Hermida 396d36e4ba Update messages catalog 2018-09-18 17:19:20 +02:00
Miguel Gonzalez f5f02585c9 Add Developer Certificate of Origin 2018-09-18 12:36:39 +02:00
Álex Hermida a5a5395f53 Fix test_custom_fields_csv_generation 2018-09-14 13:35:09 +02:00
Álex Hermida eec207cdac Add id's to reports. Fixes #1142 2018-09-13 13:49:48 +02:00
Álex Hermida ec245fe029 Fix closed us count in profile #1121 2018-09-13 13:44:12 +02:00
Daniel García a577879ab3 Allow to delete a project csv uuid 2018-09-13 13:43:52 +02:00
Daniel García b9da70d58c Avoid receive feedback in private projects from non-member users 2018-09-13 13:41:30 +02:00
Álex Hermida 124e2838fb Save attachment values diff with attached file 2018-09-13 13:39:54 +02:00
Álex Hermida ef788d0946 Add attachment parse url 2018-09-13 13:39:54 +02:00
Álex Hermida 63dc792da0 Update change log 2018-08-12 19:07:59 +02:00
Álex Hermida 7953f3f663 Update messages catalog 2018-08-10 11:51:30 +02:00
Álex Hermida cdd6909432 Refactor removing field 2018-08-10 11:28:43 +02:00
Álex Hermida 7d7f805a1e Refactor migrations 2018-08-10 11:28:43 +02:00
Álex Hermida b8dcca672a refactor tests 2018-08-10 11:28:43 +02:00
Álex Hermida 7e9328befb Add create default duedates view to task and issues 2018-08-10 11:28:43 +02:00
Álex Hermida e88c380329 Fix tests 2018-08-10 11:28:43 +02:00
Álex Hermida 02558ed15f Add create default due dates view 2018-08-10 11:28:43 +02:00
Álex Hermida fdb7ec3382 Add due date fields to import/export api 2018-08-10 11:28:43 +02:00
Álex Hermida 6f333d8012 Add duedates configuration to project template factory 2018-08-10 11:28:43 +02:00
Álex Hermida 484739e882 Update default duedate colors 2018-08-10 11:28:43 +02:00
Álex Hermida 0d37d34ad2 Remove default duedates attrs & refactor 2018-08-10 11:28:43 +02:00
Álex Hermida 8edde0fe31 Upgrade initial project template with duedate data 2018-08-10 11:28:43 +02:00
Álex Hermida 872ad281b4 Add duedates attributes to retrive project 2018-08-10 11:28:43 +02:00
Álex Hermida 0ea3898f8d Add project template data and update admin 2018-08-10 11:28:43 +02:00
Álex Hermida 6a5e870564 Add task & issues due dates configuration 2018-08-10 11:28:43 +02:00
Álex Hermida 758109ac22 Add US duedates configuration 2018-08-10 11:28:43 +02:00
Daniel García 4dd525972b Include attachments in issue view when necessary 2018-08-10 11:28:43 +02:00
Álex Hermida 16a729a078 Avoid milestone validation on bulk issues 2018-08-10 11:28:43 +02:00
Álex Hermida 27e762eac6 Add milestone filter to issues 2018-08-10 11:28:43 +02:00
Álex Hermida ab59782103 Add tests & milestone to Issues bulk-create 2018-08-10 11:28:43 +02:00
Álex Hermida b6b421245e Update change log 2018-08-05 22:23:21 +02:00
Miguel Gonzalez e04c258e24 fix: Fix apply_order_updates algorithm
With this commit changes detection is improved. It fixes a regression
introduced by be66c3270c.
2018-08-03 14:30:06 +02:00
Miguel Gonzalez d34166573f Drop python 3.4 and add python 3.6 2018-08-03 14:29:39 +02:00
Miguel Gonzalez 989fcfe466
Merge pull request #1151 from migonzalvar/fix/export
Fix project export done email
2018-07-16 07:27:54 +02:00
Miguel Gonzalez 8ca22009df Fix unintended template filter name overriding 2018-07-12 19:52:46 +02:00
Miguel Gonzalez 59b5646322 Add test_emails command 2018-07-12 19:51:35 +02:00
Miguel Gonzalez 4f5db05fae Update change log 2018-07-04 20:38:29 +02:00
Daniel García 2744aa52f0 User Stories Role Filter 2018-07-03 15:58:15 +02:00
Álex Hermida 5974ca6ce3 Add test filter assigned users by role 2018-07-03 15:58:15 +02:00
Álex Hermida 8e01fbc97b Update role filter data 2018-07-03 15:58:15 +02:00
Miguel Gonzalez 610938c026
Merge pull request #1136 from alexhermida/ft/fix_unassinged_users_count
Fix assigned users filters unassigned
2018-07-03 09:16:38 +02:00
Álex Hermida 93029f99f4 Fix tests 2018-06-28 17:46:59 +02:00
Álex Hermida 006bc72e67 Change assigned_users us_counter to include assigned_users and assigned_to 2018-06-28 13:54:54 +02:00
Álex Hermida 7bec90f59c Fix assigned users filter to work well with None and multiple filters 2018-06-28 13:37:06 +02:00
Miguel Gonzalez a781b3c3e2 Set correct version 2018-06-27 23:22:54 +02:00
Álex Hermida 1af507685d Updated change log 2018-06-27 17:49:23 +02:00
Álex Hermida 0cad037beb Change get_assigned_users_filter to 'or' 2018-06-27 17:18:34 +02:00
Álex Hermida 516d8773e7 Add filter assigned users for None case 2018-06-27 17:03:48 +02:00
Álex Hermida 7a4bdbf6dc Add userstories assigned users filters data 2018-06-27 00:18:51 +02:00
Álex Hermida 1d6c559189 Add filters data assigned users tests 2018-06-27 00:18:51 +02:00
Miguel Gonzalez be66c3270c Fix reorder does not introduce new holes 2018-06-26 17:44:42 +02:00
Miguel Gonzalez 1b0b879843 Upgrade psycopg2 library 2018-06-26 12:39:28 +02:00
Miguel Gonzalez aa2fa445c3 Update change log 2018-06-13 20:20:16 +02:00
Miguel Gonzalez 5927ad0794 Merge branch 'alexhermida-ft/fix_filter' 2018-06-12 17:36:28 +02:00
Álex Hermida 069a79a174 Refactor AssignedUsersFilter 2018-06-12 17:36:16 +02:00
Álex Hermida 1e9aaf1a82 Add test_get_user_stories_assigned_users 2018-06-12 17:36:16 +02:00
Álex Hermida e3b69def6c Alter verbose name read_new_terms on user 2018-06-12 17:33:08 +02:00
Miguel Gonzalez ab27d686bc Update change log 2018-05-30 20:15:48 +02:00
Álex Hermida 3e9b502b9b Prevent history user error with id 2018-05-30 16:58:36 +02:00
Álex Hermida 73597b564b Prevent error on US with email in history owner attr 2018-05-30 16:58:36 +02:00
Miguel Gonzalez 2a436d53dd Resolve incompatible dependencies pinning specific versions
The new pip 10 detects incompatible versions for asana and requests.

It is solved by upgrading `asana` to the latest available patch release
and pinning `idna` version to the one required by `requests`.
2018-05-30 16:30:34 +02:00
Miguel Gonzalez 41c8b9c810 Update change log 2018-05-23 21:58:05 +02:00
Álex Hermida 1dc19695b5 Improve assigned users filter to have old US's 2018-05-23 14:04:04 +02:00
Daniel García 4001c57359 Remove temporary csv file after being appended to user profile zip file 2018-05-23 14:04:04 +02:00
Daniel García 648a1f1dbb accepted_terms field required in register 2018-05-23 14:04:04 +02:00
Álex Hermida ebb6dfc3c3 Add user new terms modifications 2018-05-23 14:04:04 +02:00
Miguel Gonzalez 29daac11df Pin kombu version to match celery
See https://github.com/celery/kombu/issues/873
2018-05-22 18:33:35 +02:00
Daniel García 6c53e94909 Download user data as zip 2018-05-22 13:13:13 +02:00
Miguel Gonzalez 9aae14a332 Update change log 2018-05-09 21:28:18 +02:00
Miguel Gonzalez c05b7f7781 [i18n] Update locales 2018-05-09 21:23:44 +02:00
Miguel Gonzalez 5434440c45 Add Persian (Iran) language 2018-05-09 21:06:17 +02:00
Álex Hermida b13d6b3cbf Add assigned users dashboard filter 2018-04-30 12:15:23 +02:00
Miguel Gonzalez d0ec0f9074 Update change log 2018-04-29 23:02:32 +02:00
Álex Hermida 8419baadde Avoid unassigned activity 2018-04-26 13:19:19 +02:00
Álex Hermida c7111a29b1 Fix history unassigned 2018-04-26 07:52:38 +02:00
Miguel Gonzalez 9fae7e1ef8 [i18n] Update locales 2018-04-25 19:10:35 +02:00
Alex Hermida b464da2b99
Merge pull request #1097 from taigaio/3.3.0rc
3.3.0rc
2018-04-24 13:35:32 +02:00
Álex Hermida dc3c5f3edd Update changelog 2018-04-24 12:46:31 +02:00
Álex Hermida cecf92d683 Update due date threshold to 14 days 2018-04-24 12:28:19 +02:00
Álex Hermida 76414c75d4 Add snapshot migration for userstories to avoid unnecessary history entries 2018-04-24 12:28:13 +02:00
Miguel Gonzalez 6faed218ba feature: Add trace information to SQL statement 2018-04-24 12:27:57 +02:00
Álex Hermida ee862b0748 Add due date & due date rease to webhooks 2018-04-24 12:27:57 +02:00
Álex Hermida 8fbf4b8068 Add assigned users to webhooks 2018-04-24 12:27:57 +02:00
Álex Hermida 1d4c731624 Update csv test and rebase migration 2018-04-24 12:27:39 +02:00
Álex Hermida f95d9f28be * Add timeline tests
* Improve factory
* Add default to exclude fields
2018-04-24 12:26:19 +02:00
Álex Hermida de7ab4c474 Add excluded keys to make diff 2018-04-24 12:20:55 +02:00
Álex Hermida 94fcbbc55e Add assigned users to us
Also:
 * csv export
 * json export
 * import validator
 * history
 * Email template
2018-04-24 12:18:50 +02:00
Alex Hermida 2284ec6b6e
Merge pull request #1092 from dangarbar/ft/due-date-activity
Ft/due date activity
2018-04-13 23:38:09 +02:00
Álex Hermida fb36b14ff0 Change default live notify policy level to involved 2018-04-13 09:34:26 +02:00
Daniel García 885abdf5d2 Format due dates in email templates 2018-04-12 13:32:59 +02:00
Daniel García 4e58bf7413 Improve due date format in freezers 2018-04-12 12:12:32 +02:00
Daniel García 6e8b5d1c2b Repair tests 2018-04-11 11:34:00 +02:00
Miguel Gonzalez c2149ef6a5 Added due_date to taks, us and issues 2018-04-11 11:34:00 +02:00
Miguel Gonzalez 8b76b5787b doc: Update changelog 2018-04-11 11:34:00 +02:00
Jesús Espino b6b7ff6d9b Adding live notifications configuration 2018-04-10 12:22:21 +02:00
Jesús Espino d74094295c Working on live-notifications 2018-04-10 12:22:21 +02:00
Miguel Gonzalez 8651f31d13 Update change log 2018-04-03 21:04:13 +02:00
Miguel Gonzalez b02612a166 [i18n] Update locales 2018-04-03 21:01:35 +02:00
Álex Hermida 3f9b20b34e Upgrade Markdown version to solve 'infinite execution' bug. 2018-04-02 13:22:12 +02:00
Álex Hermida 8f95d9333e Add unreleased to changelog 2018-04-02 13:21:45 +02:00
Jesús Espino 825ca74311 Fix #5238: Milestone burndown graph take into account empty user stories 2018-04-02 13:21:45 +02:00
Miguel Gonzalez 34bf9309fe Merge branch 'master' into stable 2018-03-15 15:30:12 +01:00
Miguel Gonzalez cab876485d Update change log 2018-03-15 15:27:07 +01:00
Alejandro 19ca928936
Merge pull request #1083 from migonzalvar/fix/improve-sorting-performance
Remove wrong check about status
2018-03-15 14:07:57 +01:00
Alejandro c2e6721934
Merge pull request #1082 from migonzalvar/ref/apply_order_updates
Do not include items which does not change
2018-03-15 14:07:45 +01:00
Miguel Gonzalez 0444044646 Fix test (2/) 2018-03-15 12:01:59 +01:00
Miguel Gonzalez 0ea9ebe449 Fix unit test 2018-03-15 11:53:39 +01:00
Miguel Gonzalez 46558ea63d Remove equal original optionally 2018-03-15 11:40:28 +01:00
Miguel Gonzalez fab4364cc0 Fix test (2/) 2018-03-15 11:40:28 +01:00
Miguel Gonzalez 804b09f6a0 Fix test (1/) 2018-03-15 11:40:28 +01:00
Miguel Gonzalez bae2881ed6 Do not include items which does not change 2018-03-14 14:48:14 +01:00
Miguel Gonzalez d8b8c1655b Remove wrong check about status
Do not validate is target status is the current one.
2018-03-14 13:27:13 +01:00
Miguel Gonzalez aed3159026 Merge branch 'master' into stable 2018-03-07 07:02:42 +01:00
Álex Hermida 92368c38c4 Update changelog 2018-03-06 16:22:47 +01:00
Álex Hermida 34fbb01fe0 Fix file upload permissions 2018-02-27 21:09:28 +01:00
Alejandro af6d4aa21a
Merge pull request #1078 from alexhermida/TG-5347
TG-5347 Fix file upload permissions
2018-02-27 17:21:58 +01:00
Álex Hermida 2d54d1b432 Fix file upload permissions 2018-02-27 17:04:16 +01:00
Jesús Espino 6d8c6df657 Add role filtering 2018-02-26 18:02:34 +01:00
Miguel Gonzalez b05da06ab2 Avoid empty notifications when no effective modifications (#1074)
Fix TG-5341
2018-02-21 07:01:06 +01:00
Miguel Gonzalez 1bbc3268fd
Avoid empty notifications when no effective modifications (#1074)
Fix TG-5341
2018-02-21 06:59:26 +01:00
Miguel Gonzalez d3a754997b Merge branch 'release/3.1.1' into stable 2018-02-20 07:06:33 +01:00
Miguel Gonzalez bbbb348674 update all active languages 2018-02-19 11:26:38 +01:00
Miguel Gonzalez 32512d70a2 update es django.po 2018-02-16 09:26:59 +01:00
Miguel Gonzalez c12f48aa65 update translations 2018-02-15 18:21:17 +01:00
Alejandro 880289b0a7
Merge pull request #1071 from migonzalvar/TG-5334
Add unsubscribe link to every notification email
2018-02-13 08:56:38 +01:00
Alejandro 648fb12d39
Merge pull request #1065 from alexhermida/feature/not_found_in_forbidden
Feature/not found in forbidden
2018-02-12 15:46:16 +01:00
Alex Hermida ea4559ff3e Uncomment test code 2018-02-12 13:49:41 +01:00
Alex Hermida f7f3cc806b Add comment to project retrieve filter 2018-02-12 13:49:41 +01:00
Alex Hermida 91f4d395f5 Customize project retrieve to filter queryset 2018-02-12 13:46:45 +01:00
Alejandro b7c095525a
Merge pull request #1062 from migonzalvar/increase-token-entropy
Increase entropy of tokens used for authentication
2018-02-12 12:11:49 +01:00
Alejandro cf2abe1d2f
Merge pull request #1069 from migonzalvar/squash-notifications
Squash field changes on notification emails
2018-02-12 12:11:18 +01:00
Miguel Gonzalez c7d90ea9b7 add link to email configuration settings as unsubscribe option 2018-02-08 12:34:58 +01:00
Miguel Gonzalez c949c67dc0 add list unsubscribe header described in RFC2369 2018-02-08 12:34:58 +01:00
Miguel Gonzalez a59704af1d add front url for change mail notifications settings 2018-02-08 11:15:15 +01:00
Jesús Espino ee3e94d2e7 [backport] Add advisory lock to send_notifications 2018-02-07 10:48:15 +01:00
Jesús Espino bc2f1b57df Add advisory lock to send_notifications 2018-02-07 10:48:04 +01:00
Miguel Gonzalez 9337f04621 activate tags field 2018-02-06 14:17:31 +01:00
Miguel Gonzalez 3180dfeda0 move import to the top 2018-02-06 13:45:34 +01:00
Miguel Gonzalez 1a3b6bc3ca apply squash_history_entries 2018-02-05 21:20:05 +01:00
Miguel Gonzalez dbafa5264d add initial implementation notifications squashing 2018-02-05 21:19:39 +01:00
Miguel Gonzalez 75545eb256 add space 2018-02-01 20:34:48 +01:00
Miguel Gonzalez 5fbcbfb68c Increase entropy of tokens used for authentication 2018-02-01 19:57:16 +01:00
Jesús Espino 0903bfa6de [backport] Adding endpoint to remove members from may plan 2018-01-30 21:44:59 +01:00
Jesús Espino ae558ad471 Adding endpoint to remove members from may plan 2018-01-30 21:43:21 +01:00
Alex Hermida 9eeace6584 Add test get private project by slug 2018-01-17 18:47:42 +01:00
David Barragán Merino b798846c5c
Add missed option 2017-12-09 16:50:04 +01:00
Jesús Espino ece8bb7ce6 added date_joined field to user serializer 2017-12-04 12:19:59 +01:00
Jesús Espino 07b430db4f added date_joined field to user serializer 2017-11-16 11:29:17 +01:00
Jesús Espino acc88bd31e [backport] Generating unique user id for analytics 2017-11-04 20:08:26 +01:00
Jesús Espino 52ce32edf4 Generating unique user id for analytics 2017-11-04 20:04:30 +01:00
Jesús Espino 14f5ad4bdd Quick fix for last_login error 2017-10-31 12:50:00 +01:00
Jesús Espino 843b9a7472 Quick fix for last_login error 2017-10-31 12:39:20 +01:00
Jesús Espino 0ede2a67be Update last_login in each api call 2017-10-31 12:25:08 +01:00
Jesús Espino 5bc9c06f08 Update last_login in each api call 2017-10-31 12:22:44 +01:00
David Barragán Merino 62bdc296ae
Merge pull request #1036 from amureki/readme
Proper Kaleidos Project link
2017-10-31 12:05:02 +01:00
Rustem Sayargaliev 98a9a06d38 Proper Kaleidos Project link 2017-10-21 12:58:12 +02:00
gabrielecker 462ca1eccd Remove invalid command from README development section 2017-10-20 16:21:27 +02:00
Michael Jurke abaa6ddcb3 Extend order_by_fiels for user stories and issues
Add order_by_fields to tasks and milestones
2017-10-20 12:57:59 +02:00
Jesús Espino 49650db332 [backport] Other jira import small fix 2017-10-16 15:45:23 +02:00
Jesús Espino 42d88124bc Other jira import small fix 2017-10-16 15:45:13 +02:00
Jesús Espino 2b463bb269 [backport] Another fix in Jira importer 2017-10-16 08:16:51 +02:00
Jesús Espino 673d1bfc3b Another fix in Jira importer 2017-10-16 08:16:32 +02:00
Jesús Espino b6657531c1 [backport] Other Jira bug fixed 2017-10-11 16:49:13 +02:00
Jesús Espino ca7383af1a Other Jira bug fixed 2017-10-11 16:48:57 +02:00
Jesús Espino 1d894bbb8f [backport] More fixes in jira import 2017-10-11 11:44:40 +02:00
Jesús Espino abeda21ea4 More fixes in jira import 2017-10-11 11:44:25 +02:00
Jesús Espino c389d99200 [backport] Fixing bug on jira importer 2017-10-10 09:35:06 +02:00
Jesús Espino 73e02a5584 Fixing bug on jira importer 2017-10-10 09:34:49 +02:00
Jesús Espino 28dba6dc66 [backport] Fix small problem in Jira import 2017-10-09 13:48:38 +02:00
Jesús Espino eb9b393ec9 Fix small problem in Jira import 2017-10-09 13:48:19 +02:00
David Barragán Merino 3976ceef4f [i18n] Update locales 2017-10-06 11:43:45 +02:00
Jesús Espino 28b20b5f9a [backport] Fixed typo on sitemaps 2017-10-06 08:16:07 +02:00
Jesús Espino 448589a1ed Fixed typo on sitemaps 2017-10-06 08:15:49 +02:00
Jesús Espino f507cd0539 [backport] Updating sitemaps 2017-10-04 13:33:50 +02:00
Jesús Espino cdd1d2809c Updating sitemaps 2017-10-04 13:31:21 +02:00
Jesús Espino e9b9a962c6 [backport] Fix throttling bug 2017-09-11 22:05:17 +02:00
Jesús Espino 66477c6777 Fix throttling bug 2017-09-11 16:40:43 +02:00
David Barragán Merino 2533507fc1 [Backport] Use new get_model method 2017-08-23 13:40:41 +02:00
Alejandro 8a9964446a Merge pull request #1019 from taigaio/bug/deprecate_django_method
Use new get_model method
2017-08-23 13:39:49 +02:00
David Barragán Merino 4c6ac330bf Use new get_model method 2017-08-23 13:21:39 +02:00
Alejandro b32a8695de Merge pull request #1018 from taigaio/bug/fix_project_history
Fix project freeze and add permissions
2017-08-23 13:21:03 +02:00
David Barragán Merino 3d3d79a4b3 Fix project freeze and add permissions 2017-08-23 13:20:29 +02:00
Jesús Espino 33833d027a [Backport] Add user update throttling 2017-08-23 13:16:25 +02:00
Alejandro b06e28e596 Merge pull request #1020 from taigaio/add-user-update-throttling
Add user update throttling
2017-08-23 13:14:13 +02:00
Jesús Espino 1fb61dfc0f Add user update throttling 2017-08-23 12:16:22 +02:00
Jesús Espino 61c0653898 [Backport] Fixed SVG thumbnail generation 2017-07-21 10:03:26 +02:00
Jesús Espino 0ddbf27d5c [Backport] Fix problem with fetch urls from cairoSVG 2017-07-21 10:03:21 +02:00
Alejandro a0f83fef64 Merge pull request #1013 from taigaio/url-fetcher-for-cairo-svg
Fix problem with fetch urls from cairoSVG
2017-07-21 09:47:18 +02:00
Jesús Espino 0930228c27 Fixed SVG thumbnail generation 2017-07-21 09:45:57 +02:00
Jesús Espino d35135a3f5 Fix problem with fetch urls from cairoSVG 2017-07-20 13:41:11 +02:00
Alejandro Alonso d1dd3631f9 [Backport] Improving epics progress 2017-06-23 12:59:30 +02:00
Alejandro Alonso 9b80f5a1a3 Improving epics progress 2017-06-23 10:24:44 +02:00
David Barragán Merino c698b0798b Upgrade requirements.txt 2017-06-23 10:22:17 +02:00
LouieK22 386893f2e4 Just a small grammar fix.
Am I the only one who noticed this? Can someone just accept this?

lel, I did this the wrong way, right?
2017-06-23 10:16:46 +02:00
David Barragán Merino c8692eeca4 Add the CoC 2017-06-19 13:11:45 +02:00
Alejandro Alonso e75510507c [Backport] Imported projects notify incorrect users in some cases 2017-05-30 15:15:18 +02:00
David Barragán Merino e7c58fa670 Merge pull request #994 from taigaio/issue/5137/imported-projects-notify-incorrect-users-in-some-cases
Imported projects notify incorrect users in some cases
2017-05-30 13:14:04 +00:00
Alejandro Alonso a2d1547fae Imported projects notify incorrect users in some cases 2017-05-30 14:44:37 +02:00
Jesús Espino e715c7b03e [Backport] Fixing ordering in archived states 2017-05-19 13:13:40 +02:00
Jesús Espino cb6f3bb0fe [Backport] Revert "Making update_attr_in_bulk_for_ids work in asynch mode if possible"
This reverts commit 479454cbde.
2017-05-19 13:13:23 +02:00
Alejandro c48b99be75 Merge pull request #995 from taigaio/fixing-ordering-on-archived
Fixing ordering in archived states
2017-05-19 13:12:05 +02:00
Jesús Espino deece59b6b Fixing ordering in archived states 2017-05-18 08:47:34 +02:00
Jesús Espino a385c73abb Revert "Making update_attr_in_bulk_for_ids work in asynch mode if possible"
This reverts commit 479454cbde.
2017-05-17 12:50:13 +02:00
Alejandro Alonso 74a8e8e365 [Backport] Making update_attr_in_bulk_for_ids work in asynch mode if possible 2017-05-10 06:49:55 +02:00
Jesús Espino 3f20f941bc Merge pull request #992 from taigaio/making-update_attr_in_bulk_for_ids-work-in-asynch-mode
Making update_attr_in_bulk_for_ids work in asynch mode if possible
2017-05-10 06:47:36 +02:00
Alejandro Alonso 479454cbde Making update_attr_in_bulk_for_ids work in asynch mode if possible 2017-05-09 12:59:33 +02:00
Jesús Espino 4d59996620 Merge pull request #977 from taigaio/remove-users-table-full-scan
Remove users table full-scan
2017-04-06 14:56:49 +02:00
Jesús Espino 3dccb9e90e Adding extra index to improve slow queries speed 2017-04-06 09:34:26 +02:00
Jesús Espino 8f1f001872 Remove users table full-scan 2017-04-05 18:37:14 +02:00
Jesús Espino ce4739aef3 Merge pull request #969 from taigaio/svg-thumbnail-generation-by-content
Limit the svg generation by detecting svg by content
2017-03-28 16:21:45 +02:00
Jesús Espino 3b617946e0 Limit the svg generation by detecting svg by content 2017-03-28 15:52:58 +02:00
David Barragán Merino 84dfbbd0b0 Merge pull request #965 from taigaio/fixing-list-of-users
Fixing list of users on jira importer
2017-03-24 14:16:53 +01:00
Jesús Espino b4ca93ec28 Fixing list of users in jira importer 2017-03-24 12:02:48 +01:00
Jesús Espino e9dbe4519f Merge branch 'master' into stable 2017-03-23 18:57:43 +01:00
David Barragán Merino 9ea2d9c66b Merge pull request #963 from taigaio/issue-5017/import-from-jira
Capture invalid response from the jira server
2017-03-23 18:51:54 +01:00
Jesús Espino cfbe29e9a0 Add callback url to jira importer 2017-03-23 18:43:42 +01:00
Jesús Espino 500fe01b6e Fix jira auth data creation 2017-03-23 17:41:14 +01:00
Jesús Espino e3b390087a Capture invalid response from the jira server 2017-03-22 15:17:29 +01:00
Alejandro Alonso 38423ff57e [Backport] Fixing svg processors 2017-03-17 13:13:43 +01:00
David Barragán Merino 1c569edd96 Merge pull request #955 from taigaio/fixing-svg-processor
Fixing svg processors
2017-03-17 13:08:42 +01:00
Alejandro Alonso a726f2882b Fixing svg processors 2017-03-17 12:32:31 +01:00
David Barragán Merino 8958e6844c [Backport] Fix test_emails command and add some missed emails 2017-03-15 17:35:39 +01:00
David Barragán Merino 282b964bd3 Fix test_emails command and add some missed emails 2017-03-15 17:33:52 +01:00
David Barragán Merino 363c9432f5 Allow to resolve wikipages with references endpoint 2017-03-14 12:57:01 +01:00
David Barragán Merino 8d7fd290e2 [Backport] Fix trello importer error where avatarHash is a NoneType object 2017-03-13 12:08:16 +01:00
David Barragán Merino 2ea75b1aee Fix trello importer error where avatarHash is a NoneType object 2017-03-13 12:07:31 +01:00
Alejandro Alonso b57973767b [Backport] Fixing contact project 2017-03-13 10:50:28 +01:00
David Barragán Merino 8dbb524be6 Merge pull request #952 from taigaio/fixing-contact-project
Fixing contact project
2017-03-13 10:40:46 +01:00
David Barragán Merino eaf943c406 [Backport] Update djmail to the last version 2017-03-12 18:05:06 +01:00
Alejandro Alonso fd71ae704f Fixing contact project 2017-03-12 18:01:29 +01:00
David Barragán Merino 095d613cf9 Update djmail to the last version 2017-03-12 18:00:59 +01:00
Jesús Espino c524555d7a Fixed trello importer without avatar 2017-03-11 14:17:13 +01:00
Jesús Espino d4a342c9ea Fixed fields-diff for emails 2017-03-11 03:13:56 +01:00
Jesús Espino 4bdb00a642 Merge branch 'master' into stable 2017-03-10 17:02:48 +01:00
David Barragán Merino a97892d06f Merge pull request #949 from taigaio/issue/4995-multiline-commits-in-webhooks
Issue#4995 Fix problems with multiline commits in the webhooks
2017-03-09 13:42:15 +01:00
Jesús Espino f390404b98 Issue#4995 Fix problems with multiline commits in the webhooks 2017-03-09 09:30:14 +01:00
David Barragán Merino ad60ac2235 Catch amqp.exception.AccessRefused in taiga.events backend 2017-03-08 16:51:41 +01:00
David Barragán Merino ba7f9b2096 [i18n] Update locales 2017-03-08 16:32:57 +01:00
Jesús Espino fb9e3ebb91 Fix issue #4990: Now working import users with custom email 2017-03-07 14:39:04 +01:00
David Barragán Merino 6d9c2b660c [i18n] Update locales 2017-03-06 18:06:45 +01:00
David Barragán Merino 8279856e8b Ignore sprint and epic order field in changes 2017-03-06 17:08:14 +01:00
David Barragán Merino 3bc3ab83e0 Update CHANGELOG 2017-03-06 17:00:32 +01:00
David Barragán Merino 40577d7675 Merge pull request #947 from taigaio/gogs-new-signature
Adding new gogs signature method
2017-03-06 16:54:26 +01:00
Jesús Espino eb38517977 Adding new gogs signature method 2017-03-06 16:54:00 +01:00
David Barragán Merino 08424b97fe [i18n] Update locales 2017-03-03 14:18:44 +01:00
Jesús Espino 16caedce81 Adding licenses to files and fixing some pyflakes errors 2017-03-03 08:13:12 +01:00
Jesús Espino c90460f283 Updated requirements.txt and requirements-devel.txt 2017-03-02 16:01:28 +01:00
Jesús Espino 523ee8bbe8 Fixed bug with throttling code 2017-03-02 16:01:13 +01:00
David Barragán Merino c6d918f9d0 Merge pull request #944 from taigaio/upgrade-to-celery4
Migration from celery3 to celery4
2017-03-02 13:31:21 +01:00
Jesús Espino fd658895cb Migration from celery3 to celery4 2017-03-02 11:13:42 +01:00
David Barragán Merino 71e810b446 Update local.py.example 2017-03-02 10:51:32 +01:00
David Barragán Merino 3b697727ca Merge branch 'CharleyPeng1-patch-1' 2017-03-02 10:35:23 +01:00
CharleyPeng1 f37a6cf869 Update README.md
github does not seem to support _blank
2017-03-02 10:34:59 +01:00
David Barragán Merino d4b249042e Merge pull request #943 from taigaio/throttling
Added common throttle for all the API
2017-03-02 10:28:20 +01:00
Jesús Espino 8df7df763c Improvements in the throttling code 2017-03-02 10:26:51 +01:00
Jesús Espino 8dfcbe4006 Added common throttle for all the API 2017-03-02 10:26:51 +01:00
Jesús Espino 7019de8f0d Updated the badges to use shields.io 2017-03-01 17:12:38 +01:00
Jesús Espino 687eccf462 Removing debug lines in jira importer 2017-02-28 08:06:28 +01:00
Jesús Espino 6bdbf7c106 Fixes on jira importer async version 2017-02-28 08:02:00 +01:00
Jesús Espino 0244a39475 Adding import finished emails, and fixed tasks from the importer 2017-02-27 16:48:49 +01:00
David Barragán Merino 4107231340 Fix a typo 2017-02-27 16:15:25 +01:00
David Barragán Merino 1879cb76ae Fix celery settings 2017-02-27 16:15:13 +01:00
David Barragán Merino c5cb31521f Remove line braks 2017-02-27 16:14:51 +01:00
David Barragán Merino 7463eab3c9 Add missed __init__ files to prevent celery erros during the autodiscover tasks process 2017-02-23 19:29:21 +01:00
Jesús Espino d1a9d58813 Fixed privacy, is_looking_for_people and is_featured on sample data 2017-02-23 12:15:22 +01:00
Alejandro Alonso 7f614c0c5e Improving sample_data 2017-02-23 11:58:24 +01:00
Jesús Espino b8bf4bdd21 Changing to the new gogs logo 2017-02-22 18:29:49 +01:00
David Barragán Merino 8f20575e6e [i18n] Update locales 2017-02-20 18:19:50 +01:00
David Barragán Merino 8dbd3df40e Update copyright 2017-02-20 17:58:01 +01:00
David Barragán Merino 78f5b9e961 [i18n] Update locales 2017-02-20 12:31:21 +01:00
David Barragán Merino f9adc543d4 Merge pull request #910 from taigaio/github-import
Adding Jira, Trello, Asana, PivotalTracker and Github importers to back
2017-02-20 12:29:22 +01:00
David Barragán Merino 0438a389b0 Add sample settings in local.py.example 2017-02-20 12:14:09 +01:00
Jesús Espino 176e2fc2c5 Adding avatar to list_user function in importers 2017-02-20 12:14:09 +01:00
Jesús Espino aaedfab439 Change settings format for importers 2017-02-20 12:14:09 +01:00
Jesús Espino a952d200fc Improved users_bindings 2017-02-15 12:07:51 +01:00
Jesús Espino ea7187b30d Capture any error processing authorization on github and convert it to a Http400 2017-02-15 12:07:51 +01:00
David Barragán Merino c2b0ac84e6 [i18n] Fix some messages and update locales 2017-02-15 12:07:45 +01:00
Jesús Espino 475092f4c2 Add importers changelog entries 2017-02-15 12:04:57 +01:00
Jesús Espino 15c2868d24 Add pivotal importer prototype 2017-02-15 12:04:57 +01:00
Jesús Espino 477d964770 Add asana importer 2017-02-15 12:04:57 +01:00
Jesús Espino cca421b14d Add github importer 2017-02-15 12:04:57 +01:00
Jesús Espino 723034d373 Add jira importer 2017-02-15 12:04:57 +01:00
Jesús Espino f7595b65cc Add trello importer 2017-02-15 12:04:57 +01:00
Jesús Espino 9bdf1e07f1 [Backport] Avoid problems with some malformed requests 2017-02-14 22:03:36 +01:00
David Barragán Merino 23056f4e56 Merge pull request #939 from taigaio/fix-warning-on-some-malformed-requests
Avoid problems with some malformed requests
2017-02-14 21:02:21 +00:00
Jesús Espino d306900c31 Avoid problems with some malformed requests 2017-02-14 21:00:21 +01:00
Alejandro Alonso 3abd51f306 [Backport] Issue 4931: Tag Creation Caps Bug 2017-02-13 12:12:44 +01:00
David Barragán Merino e93aff73e7 Merge pull request #936 from taigaio/issue/4931/tag-creation-caps-bug
Issue 4931:Tag Creation Caps Bug
2017-02-13 11:10:23 +00:00
Alejandro Alonso 03d97f6ece Issue 4931:Tag Creation Caps Bug 2017-02-10 08:55:30 +01:00
David Barragán Merino d09dbcb3db [i18n] Update locales 2017-02-09 12:01:11 +01:00
David Barragán Merino 0a7bd3be06 [i18n] Update locales 2017-02-09 09:14:16 +01:00
David Barragán Merino 582068a7ac [i18n] Update locales 2017-02-05 13:24:02 +01:00
David Barragán Merino 503beb68b9 Add missed migration 2017-02-01 11:54:17 +01:00
David Barragán Merino 75bc33b759 Exclude contacts from a concrete project 2017-01-31 18:36:06 +01:00
David Barragán Merino 04ca4d5b7f [Backport] Fix Issue #5910: Create validator for assign_to attr 2017-01-30 12:51:43 +01:00
David Barragán Merino 65374df43f Merge pull request #925 from taigaio/issue/4910/validate_assigned_to
Fix Issue #5910: Create validator for assign_to attr
2017-01-30 12:49:53 +01:00
David Barragán Merino 45bb5c4d9b Fix Issue #5910: Create validator for assign_to attr 2017-01-30 11:35:49 +01:00
Alejandro Alonso 3f102e5e38 [Backport] Improving cancel account API endpoint 2017-01-24 08:54:24 +01:00
David Barragán Merino 748bf53159 Merge pull request #923 from taigaio/improving-cancel-account-api-endpoint
Improving cancel account API endpoint
2017-01-24 08:49:28 +01:00
Alejandro Alonso 253e7b81d8 Improving cancel account API endpoint 2017-01-24 08:13:41 +01:00
Jesús Espino 950c9a4987 [Backport] Fix sending events accidentally before commit 2017-01-23 18:20:56 +01:00
Jesús Espino a4b9140c5a {Backport} Improve the discover-speed 2017-01-20 12:06:57 +01:00
David Barragán Merino be69b59447 Merge pull request #922 from taigaio/discover-mode-speedup
Improve the discover-speed
2017-01-20 12:05:47 +01:00
Jesús Espino b82603428c Improve the discover-speed 2017-01-20 11:38:48 +01:00
David Barragán Merino 32a4473304 [i18n] Fix script 2017-01-20 10:03:39 +01:00
David Barragán Merino 49033f323a [i18n] Update locales 2017-01-20 09:49:04 +01:00
David Barragán Merino 1303a4622f Merge pull request #920 from taigaio/attachments-on-comment
Add from_comment field to attachments and allow attach files from comments
2017-01-18 14:13:03 +01:00
Jesús Espino 2ab743a44e Add from_comment field to attachments and allow attach files from comments 2017-01-18 12:26:33 +01:00
David Barragán Merino fbf6340d30 Merge pull request #921 from taigaio/psd-and-svg-preview
Adding support for preview svg and psd images
2017-01-17 19:19:21 +01:00
Jesús Espino 32ff6e67e7 Adding support for preview svg and psd images 2017-01-17 19:16:17 +01:00
David Barragán Merino 8bb20c2767 Merge pull request #918 from taigaio/svg-thumbnail-generation
Add svg thumbnail generation
2017-01-17 15:10:41 +01:00
Jesús Espino 0d3adc5d2f Add svg thumbnail generation 2017-01-17 15:09:47 +01:00
David Barragán Merino d0466c3642 [i18n] Add korean locale 2017-01-16 18:02:47 +01:00
David Barragán Merino 0deeabc3ac [i18n] Fix some typos and upsdate locales 2017-01-16 17:45:25 +01:00
Jesús Espino 314c73efe7 Add changelog about adding support for PSD files thumbnails 2017-01-13 10:17:05 +01:00
Jesús Espino 1b76977e9c [Backport] Using psd-tools for psd thumbnail 2017-01-12 21:37:45 +01:00
David Barragán Merino e12e210d2b Merge pull request #917 from taigaio/use-psd-tools-for-psd-resize
Using psd-tools for psd thumbnail
2017-01-12 21:36:25 +01:00
Jesús Espino 49d4884e83 Using psd-tools for psd thumbnail 2017-01-12 21:12:05 +01:00
Jesús Espino 6a259106be Ignore psd files for thumbnails 2017-01-12 15:51:02 +01:00
David Barragán Merino fd170b6ca9 [i18n] Update locales 2017-01-10 11:52:26 +01:00
Jesús Espino e91496b3c6 Merge pull request #870 from taigaio/us/4662/duplicate-project
US 4662: Duplicate project
2017-01-09 16:58:54 +01:00
Alejandro Alonso b635055784 US 4662: Duplicate project 2017-01-09 16:58:43 +01:00
Jesús Espino 9bf325d5f9 Add Throttling for users auth, register and detail 2017-01-05 16:01:31 +01:00
Alejandro Alonso 1790cec37d Adding management command to block projects 2017-01-05 15:55:11 +01:00
Alejandro b5fefb8f0f Merge pull request #908 from taigaio/issue/4841-invitation-login-with-plugins
Fix #4841: Use the plugins login for invitations
2017-01-04 14:50:52 +01:00
Jesús Espino 78abcab6d5 Fix #4841: Use the plugins login for invitations 2017-01-04 13:39:40 +01:00
Alejandro Alonso fd61756a2b [Backport] Fixing testing requirements 2017-01-04 11:59:43 +01:00
Alejandro Alonso 3d5b98d2a9 Fixing testing requirements 2017-01-04 11:57:23 +01:00
Alejandro Alonso ec049521e4 [Backport] Throttling membership creation 2017-01-04 11:37:32 +01:00
Jesús Espino 3601ee4696 Merge pull request #909 from taigaio/throttling-memberships-creation
Throttling membership creation
2017-01-04 11:34:41 +01:00
Alejandro Alonso 83c445dd2f Throttling membership creation 2017-01-04 11:34:09 +01:00
Jesús Espino ed9ddf9aa9 [Backport] Adding throttling to memberships 2017-01-02 14:41:57 +01:00
Alejandro 8ca91f8d57 Merge pull request #907 from taigaio/throttling-on-memberships
Adding throttling to memberships
2017-01-02 14:17:52 +01:00
Jesús Espino 81ddea4f77 Adding throttling to memberships 2017-01-02 14:17:13 +01:00
Alejandro Alonso dcb2cf5e46 [Backport] Limiting max number of pending memberships 2017-01-02 12:26:34 +01:00
Alejandro 158d7159af Merge pull request #906 from taigaio/limiting-max-number-of-pending-memberships
Limiting max number of pending memberships
2017-01-02 11:15:50 +01:00
Alejandro Alonso 7bf5ad1a4b Limiting max number of pending memberships 2017-01-02 10:17:48 +01:00
Alejandro Alonso afceb5d24b [Backport] Fixing error for empty tags 2016-12-30 09:29:16 +01:00
Alejandro Alonso 27dead1383 Fixing error for empty tags 2016-12-30 09:28:57 +01:00
David Barragán Merino 1d3691469c Update some requirements 2016-12-16 14:06:27 +01:00
Alejandro Alonso 9e6bd153fa [Backport] Issue 4822: Error in US estimations when created from Epics 2016-12-15 11:41:27 +01:00
David Barragán Merino f8ba519d1c Merge pull request #901 from taigaio/issue/4822/error-in-US-estimations-when-created-from-Epics
Issue 4822: Error in US estimations when created from Epics
2016-12-15 11:39:10 +01:00
Alejandro Alonso c84f0fdf2e Issue 4822: Error in US estimations when created from Epics 2016-12-15 10:43:05 +01:00
David Barragán Merino c53530f6e2 Fix issue #4832: 'OneToOneField' object has no attribute 'related' 2016-12-14 15:33:55 +01:00
David Barragán Merino 16856cb64f [Backport] Add alt text in Taiga logo for emails 2016-12-14 10:52:39 +01:00
David Barragán Merino e53fd22919 Add alt text in Taiga logo for emails 2016-12-14 10:51:58 +01:00
David Barragán Merino 9791fb256b Remove alt text for the logo img in email templates 2016-12-13 12:42:28 +01:00
David Barragán Merino 47ff050abe [Backport] Remove alt text for the logo img in email templates 2016-12-13 10:53:24 +01:00
Alejandro Alonso ce530e8e71 [Backport] issue 4809: sorting with some fields with filters leads to incomplete lists with duplicates on multiple pages 2016-12-02 17:32:03 +01:00
David Barragán Merino 40ec34a026 Merge pull request #893 from taigaio/Issue-4809-sorting-with-some-fields-with-filters-leads-to-incomplete-lists-with-duplicates-on-multiple-pages
issue 4809: sorting with some fields with filters leads to incomplete…
2016-12-02 17:29:53 +01:00
Alejandro Alonso f1356e5e80 issue 4809: sorting with some fields with filters leads to incomplete lists with duplicates on multiple pages 2016-12-02 12:53:38 +01:00
David Barragán Merino db9fdf06b6 Add missed migration 2016-12-01 18:42:38 +01:00
David Barragán Merino c886167da3 Merge pull request #889 from taigaio/issue-4530-some-issues-without-results
Issue 4530: some searches without results
2016-12-01 18:42:03 +01:00
Alejandro Alonso a7287df039 Issue 4530: some searches without results 2016-12-01 17:43:00 +01:00
David Barragán Merino e215fa4147 [i18n] Add locales ja nad zh-Hans 2016-12-01 16:02:05 +01:00
David Barragán Merino 6d4a4cca9b Fix json_to_jsonb migrations 2016-11-30 19:12:43 +01:00
Michael Jurke d5bc770334 Add project extra info to epics, wiki pages, issues, tasks and milestones list serializers 2016-11-28 18:54:49 +01:00
Michael Jurke 421a213f5e Add estimated_start, estimated_finish filters to tasks, userstories and milestones 2016-11-28 17:13:00 +01:00
David Barragán Merino 7d663de854 [Backport] Fix notificacion when change assignement and they are disabled 2016-11-25 18:20:21 +01:00
David Barragán Merino e3226f4cb9 Fix notificacion when change assignement and they are disabled 2016-11-25 17:32:50 +01:00
Alejandro Alonso 6354ac1c07 [Backport] Transforming tags to lowercase on creation 2016-11-25 10:02:13 +01:00
Alejandro Alonso 26e45907d7 Transforming tags to lowercase on creation 2016-11-25 10:00:30 +01:00
David Barragán Merino 86897d3469 Merge pull request #885 from taigaio/rich-text-custom-fields
Rich text custom fields
2016-11-24 20:05:03 +01:00
Jesús Espino 2c170f3d04 Add rich text custom field 2016-11-24 18:46:56 +01:00
Alejandro 3e2226e41f Merge pull request #887 from taigaio/timeline-rebuilder-as-a-service
Move the timeline rebuild to the timeline library
2016-11-24 14:15:03 +01:00
David Barragán Merino 3d1d60db32 Merge pull request #886 from taigaio/emit-events-fix
Fix sending events accidentally before commit
2016-11-24 12:55:12 +01:00
David Barragán Merino 39dabdb0c8 Fix deprectae warnings with amqp >= 2.x 2016-11-24 11:54:44 +01:00
Jesús Espino ad8b2549d7 Fix sending events accidentally before commit 2016-11-24 11:54:44 +01:00
Jesús Espino 4d3e65c603 Move the timeline rebuild to the timeline library 2016-11-24 11:51:25 +01:00
Alejandro 2a8927c06a Merge pull request #871 from taigaio/add-total-comments-to-kanban
Add total comments to kanban and taskboard
2016-11-24 11:02:07 +01:00
Alejandro Alonso 09e40b9968 Fixing sample data to make the comments consistent 2016-11-24 11:02:19 +01:00
Jesús Espino 9970f68d2b Add total comments to kanban and taskboard 2016-11-24 10:18:18 +01:00
Alejandro Alonso 5a9938931e [Backport] Fixing unassignment notifications 2016-11-24 07:59:36 +01:00
Alejandro Alonso 5449aac84d Fixing unassignment notifications 2016-11-24 07:59:18 +01:00
Alejandro Alonso a653c7240c [Backport] Issue 4768: Notify when something is unassigned 2016-11-21 18:29:00 +01:00
David Barragán Merino c0daa9180f Merge pull request #883 from taigaio/issue/4768/Notify-when-something-is-unassigned
Issue 4768: Notify when something is unassigned
2016-11-21 18:27:45 +01:00
Alejandro Alonso 5eec9dba97 Issue 4768: Notify when something is unassigned 2016-11-21 12:24:55 +01:00
David Barragán Merino 6991476ebe Merge pull request #880 from taigaio/Enabling-console-output-again
Enabling console output for runserver again
2016-11-17 14:43:47 +01:00
Alejandro Alonso 4df74d6007 Enabling console output for runserver again 2016-11-17 14:43:21 +01:00
Alejandro Alonso fe0a2a296f [Backport] Fixing API attachments order and deprecated 2016-11-17 14:42:14 +01:00
David Barragán Merino 67cc170ccc Merge pull request #879 from taigaio/Issue/4717/Attachments-in-cards-are-not-sorted-properly
Fixing API attachments order and deprecated
2016-11-17 14:41:21 +01:00
Alejandro Alonso d21b4193ce Fixing API attachments order and deprecated 2016-11-17 14:40:42 +01:00
Alejandro Alonso 4e983d51f6 [Backport] Fixing tasks order 2016-11-17 13:25:30 +01:00
Alejandro Alonso d44d666a66 Fixing tasks order 2016-11-17 12:53:54 +01:00
David Barragán Merino 3d8f637e55 Fix json_to_jsonb migrations and prevent \u0000 error 2016-11-16 13:00:27 +01:00
Jesús Espino 2d1d963733 [Backport] Small fix on epic freezer 2016-11-15 16:22:00 +01:00
David Barragán Merino e1182fb69b Merge pull request #877 from taigaio/small-fix-on-epic-freezer
Small fix on epic freezer
2016-11-15 16:20:37 +01:00
Jesús Espino 79b7ceb73f Small fix on epic freezer 2016-11-15 16:10:18 +01:00
David Barragán Merino ba76c9431f [Backport] Throw a signal when users change their email adress 2016-11-15 14:07:09 +01:00
Alejandro f18c0e2636 Merge pull request #875 from taigaio/us/4640/mailchimp-to-sendinblue
Throw a signal when users change their email adress
2016-11-15 14:06:18 +01:00
David Barragán Merino 3be846ef47 Throw a signal when users change their email adress 2016-11-15 13:37:31 +01:00
Alejandro Alonso 0fd080b101 [Backport] Fixing multiple assigned to filter on tasks 2016-11-15 12:14:02 +01:00
Alejandro Alonso c7d2e0c174 Fixing multiple assigned to filter on tasks 2016-11-15 12:13:37 +01:00
Alejandro Alonso ff87875410 [Backport] Fixing error on task update 2016-11-15 11:31:59 +01:00
Alejandro Alonso 78510cd676 Fixing error on task update 2016-11-15 11:31:41 +01:00
David Barragán Merino 5ee2e19e7b [Backport] Fix #4756: PATCH and PUT can't change user email 2016-11-15 09:06:20 +01:00
Alejandro 12e6e8e810 Merge pull request #876 from taigaio/issue/4756/dont-change-email-without-validation
Fix #4756: PATCH and PUT can't change user email
2016-11-15 09:05:09 +01:00
David Barragán Merino 4dcdbc4c73 Fix #4756: PATCH and PUT can't change user email 2016-11-14 14:49:19 +01:00
David Barragán Merino 9302936ddd Update djmail to 0.13.1 2016-11-14 10:36:47 +01:00
Alejandro Alonso 4f0323eeca Updating changelog 2016-11-11 09:17:18 +01:00
Alejandro Alonso 8b6356f80e Cleaning code 2016-11-11 08:30:22 +01:00
David Barragán Merino bebee6c8f3 Merge pull request #867 from taigaio/us/2119/get-in-touch-with-the-project-admins
US 2219: Get in touch with the project admins
2016-11-10 20:40:10 +01:00
Alejandro Alonso ec2d11c71a US 2219: Get in touch with the project admins 2016-11-10 20:39:56 +01:00
David Barragán Merino b15b346f4c Merge pull request #859 from taigaio/improving-contacts-endpoint
Improving contacts endpoints from users API
2016-11-10 20:39:25 +01:00
Alejandro Alonso 0ff9aeb119 Improving contacts endpoints from users API 2016-11-10 14:39:50 +01:00
Alejandro 17bea5b219 Merge pull request #860 from taigaio/libs/upgrade
Upgrade requirements
2016-11-10 14:38:54 +01:00
David Barragán Merino 32d2d0a07c Upgrade requirements annd change json to jsonb 2016-11-02 16:40:54 +01:00
David Barragán Merino f22b1288ec Update TravisCI settings 2016-11-02 16:36:07 +01:00
David Barragán Merino 9cd86a3699 Fix some flake8 errors 2016-10-26 10:07:12 +02:00
Alejandro Alonso a3f88db4d1 [Backport] Fixes CharField behaviour and introduces proper validation for ModelField 2016-10-21 15:16:31 +02:00
Alejandro Alonso 1c5557f330 [Backport] Issue 4679: Comment permission isn't working for external users 2016-10-21 15:15:49 +02:00
David Barragán Merino acb758d98f Merge pull request #864 from taigaio/Fixes-CharField-behaviour-and-introduces-proper-validation-for-ModelField
Fixes CharField behaviour and introduces proper validation for ModelField
2016-10-21 14:15:43 +02:00
Alejandro Alonso ebb52d0543 Fixes CharField behaviour and introduces proper validation for ModelField 2016-10-21 14:14:28 +02:00
David Barragán Merino a7ca948ddc Merge pull request #863 from taigaio/issue/4679/comment-permission-isnt-working-for-external-users
Issue 4679: Comment permission isn't working for external users
2016-10-21 14:13:02 +02:00
Alejandro Alonso 6144100713 Issue 4679: Comment permission isn't working for external users 2016-10-21 09:04:18 +02:00
Alejandro Alonso d28846dc9e [Backport] Fixing tests 2016-10-20 15:28:22 +02:00
Alejandro Alonso bc726cbcda Fixing tests 2016-10-20 15:27:57 +02:00
Yongdae Hwang 88994892f2 Update README.md
it is wrong link for translate
2016-10-20 11:23:20 +02:00
Alejandro Alonso 4d7d873302 [Backport] Tanking snapshot when creating related user stories for an epic in bulk mode 2016-10-20 10:51:18 +02:00
David Barragán Merino 060d4c7829 Merge pull request #862 from taigaio/issue/4670/first-snapshot-not-generated-for-user-stories-in-epics-section
Tanking snapshot when creating related user stories for an epic in bulk mode
2016-10-20 10:50:26 +02:00
Alejandro Alonso 2516fb9685 Tanking snapshot when creating related user stories for an epic in bulk mode 2016-10-20 09:25:01 +02:00
Xavier Julián 132f759190 Add issues temaplate 2016-10-19 10:22:18 +02:00
Alejandro Alonso 700b6de5f7 [Backport] Error on unique constratins on memberships bulk creation 2016-10-19 08:37:35 +02:00
Alejandro Alonso 99f8bfdc9f Error on unique constratins on memberships bulk creation 2016-10-19 08:37:15 +02:00
David Barragán Merino beeb17575a Update README.md 2016-10-18 15:54:43 +02:00
Alejandro Alonso 8eb4bc2b3c [Backport] Fixing upvote downvote api 2016-10-18 13:17:54 +02:00
Alejandro Alonso 15b61257ee [Backport] Issue 4652: Lost tasks on sprint view 2016-10-18 13:17:32 +02:00
David Barragán Merino 10d1b3f672 Merge pull request #856 from taigaio/fixing-upvote-downvote-api
Fixing upvote downvote api
2016-10-18 13:16:27 +02:00
Alejandro Alonso c2637e02e9 Fixing upvote downvote api 2016-10-18 13:16:02 +02:00
David Barragán Merino 499aecb9c8 Merge pull request #855 from taigaio/issue/4652/lost-tasks-on-sprint-view
Issue 4652: Lost tasks on sprint view
2016-10-18 13:15:20 +02:00
Alejandro Alonso 15b9fb5f53 Issue 4652: Lost tasks on sprint view 2016-10-18 13:14:56 +02:00
Alejandro Alonso 6a15bb1f10 [Backport] Error on unique constratins on cretaion for epic related user stories 2016-10-18 12:13:27 +02:00
David Barragán Merino 6483108a49 Merge pull request #850 from taigaio/error-on-unique-constraints-on-creation-for-epic-related-user-stories
Error on unique constratins on cretaion for epic related user stories
2016-10-18 12:10:52 +02:00
Alejandro Alonso a1e3812bbf Error on unique constratins on cretaion for epic related user stories 2016-10-18 12:03:54 +02:00
David Barragán Merino a64c08d2ad Merge branch 'stadia-patch-1' 2016-10-18 11:56:54 +02:00
Yongdae Hwang c334836ef2 Make migration compatible with EnterpriseDB 9.4 2016-10-18 11:55:35 +02:00
David Barragán Merino 93b52a87ba [Backport] Clean duplicate code in project slug generation process 2016-10-18 09:40:56 +02:00
Alejandro 1bd8b59ea2 Merge pull request #852 from taigaio/refactor/project-slug-method
Clean duplicate code in project slug generation process
2016-10-18 09:40:17 +02:00
David Barragán Merino f7918abddb Clean duplicate code in project slug generation process 2016-10-18 09:12:41 +02:00
David Barragán Merino 17462a888a [Backport] Create command to change project slug 2016-10-18 09:12:21 +02:00
Alejandro 67669eb817 Merge pull request #853 from taigaio/commands/change_project_slug
Create command to change project slug
2016-10-18 09:11:19 +02:00
David Barragán Merino 63cd90c417 Create command to change project slug 2016-10-18 08:44:11 +02:00
Alejandro Alonso b8a8d172f6 [Backport] Fixing project validation on hooks app 2016-10-17 10:48:11 +02:00
Alejandro Alonso be55c5cb58 Fixing project validation on hooks app 2016-10-17 10:47:48 +02:00
Alejandro Alonso 8919e14708 [Backport] Fixing sql related with tags 2016-10-17 10:22:55 +02:00
Alejandro Alonso b78d1b9a26 Fixing sql related with tags 2016-10-17 10:22:34 +02:00
Alejandro Alonso d7c580b802 [Backport] Fixing and refactoring by_ref api endpoints 2016-10-13 16:00:10 +02:00
David Barragán Merino 4564802fd9 Merge pull request #849 from taigaio/fixing-and-refactoring-by-ref-api-endpoints
Fixing and refactoring by ref api endpoints
2016-10-13 15:51:17 +02:00
Alejandro Alonso 9d3e53f3c5 Fixing and refactoring by_ref api endpoints 2016-10-13 15:50:36 +02:00
David Barragán Merino 7952fb63ee Merge branch 'allan-simon-patch-1' 2016-10-13 12:14:24 +02:00
Allan Simon ea0f496c9b simplified how the get_total_points is calculated 2016-10-13 12:13:41 +02:00
Jesús Espino c219fbdc59 [Backport] Adding cache to HistoryEntry values_diff 2016-10-11 16:19:34 +02:00
Alejandro Alonso 48914e1856 [Backport] Errors on unique constraints on creation 2016-10-11 16:19:12 +02:00
David Barragán Merino 6eed67e969 [Backport] Fix issue tg-4633: Return project attributes in the correct order 2016-10-11 16:18:34 +02:00
David Barragán Merino a165947179 Merge pull request #847 from taigaio/add-cache-to-history-entry-values-diff
Adding cache to HistoryEntry values_diff
2016-10-11 16:16:28 +02:00
Jesús Espino ce99a949c7 Adding cache to HistoryEntry values_diff 2016-10-11 16:15:44 +02:00
David Barragán Merino 5267c65d60 Merge pull request #846 from taigaio/error-on-unique-constraints-on-creation
Errors on unique constraints on creation
2016-10-11 16:14:54 +02:00
Alejandro Alonso 4ae4c40ba8 Errors on unique constraints on creation 2016-10-11 16:14:27 +02:00
David Barragán Merino c1fe365ab8 Merge pull request #845 from taigaio/issue/4633/sort_attributes_in_project
Fix issue tg-4633: Return project attributes in the correct order
2016-10-11 16:13:34 +02:00
David Barragán Merino cb027411e2 Fix issue tg-4633: Return project attributes in the correct order 2016-10-11 16:13:01 +02:00
Alejandro Alonso eeee1efa70 [Backport] Fixing apply_order_updates method 2016-10-11 10:20:36 +02:00
Alejandro Alonso cda0d6451c Fixing apply_order_updates method 2016-10-11 09:49:07 +02:00
Alejandro Alonso 6a8274e7c1 [Backport] Making capitalized tags work properly 2016-10-11 09:30:47 +02:00
Alejandro Alonso 21520aaf76 [Backport] Fixing method total_closed_points_by_date for milestone model 2016-10-11 09:30:21 +02:00
Alejandro Alonso bdd312e9e8 Making capitalized tags work properly 2016-10-11 08:59:25 +02:00
Alejandro Alonso 8c3fed2088 Fixing method total_closed_points_by_date for milestone model 2016-10-11 08:58:25 +02:00
Alejandro Alonso 67e2ec6905 [Backport] Fixing commit webhooks 2016-10-11 07:36:37 +02:00
Alejandro Alonso 922571c56b Fixing commit webhooks 2016-10-11 07:36:17 +02:00
Alejandro Alonso a9d46c2bea [Backport] Fixing send_notifications command 2016-10-07 07:44:46 +02:00
Alejandro Alonso 853b896b3a Fixing send_notifications command 2016-10-07 07:44:27 +02:00
Alejandro Alonso a10bf440ad [Backport] Fixing webhooks test API call if the response isnt a valid json 2016-10-06 12:34:41 +02:00
David Barragán Merino 9e09aacc5e Merge pull request #839 from taigaio/Fixing-webhooks-tests-call-if-the-response-inst-a-valid-json
Fixing webhooks test API call if the response isnt a valid json
2016-10-06 12:28:42 +02:00
Alejandro Alonso 2520eb3d07 Fixing webhooks test API call if the response isnt a valid json 2016-10-06 09:48:18 +02:00
David Barragán Merino 057804248f [Backport] Remove BrowsableAPIRenderer and XMLRenderer 2016-10-06 07:42:11 +02:00
Alejandro 165369572a Merge pull request #841 from taigaio/remove-api-html-renderer
Remove BrowsableAPIRenderer and XMLRenderer
2016-10-06 07:41:03 +02:00
David Barragán Merino ea642a800f Remove BrowsableAPIRenderer and XMLRenderer 2016-10-05 12:49:57 +02:00
Alejandro Alonso 8edbb1baaa [Backport] Fixing deadlocks on update_attr_in_bulk_for_ids 2016-10-04 18:24:06 +02:00
David Barragán Merino 7488878550 Merge pull request #836 from taigaio/Fixing-deadlocks-on-update_attr_in_bulk_for_ids
Fixing deadlocks on update_attr_in_bulk_for_ids
2016-10-04 18:23:10 +02:00
Alejandro Alonso 318d887d6e Fixing deadlocks on update_attr_in_bulk_for_ids 2016-10-04 17:30:30 +02:00
David Barragán Merino f7c9eb157b [Backport] Add description to UserStrory serializer for webhook request 2016-10-03 17:12:20 +02:00
David Barragán Merino dedaa977bf Add description to UserStrory serializer for webhook request 2016-10-03 17:11:37 +02:00
Alejandro Alonso 882c1f00e5 [Backport] Issue 4593: Issue blocking. Not working 2016-10-03 12:01:43 +02:00
Alejandro Alonso 387becc46a Issue 4593: Issue blocking. Not working 2016-10-03 12:01:20 +02:00
Alejandro Alonso defdffe047 [Backport] Fixing bulk update API call with empty arrays 2016-10-02 17:39:38 +02:00
Alejandro Alonso f502b7e243 Fixing bulk update API call with empty arrays 2016-10-02 17:38:41 +02:00
Alejandro 7754d315f0 Merge pull request #823 from taigaio/remove-secret-key-on-applications
Remove secret key on external apps
2016-10-02 11:17:57 +02:00
Jesús Espino 84ff014be2 Adding create_taiga_tribe_app command 2016-10-02 11:16:49 +02:00
Jesús Espino 0ba2f6002a Remove secret key on external apps 2016-10-02 11:16:49 +02:00
David Barragán Merino 9e9c302ada Merge branch 'master' into stable 2016-09-30 18:59:06 +02:00
David Barragán Merino 5472c993f8 Add colors in tags for yhr filter data endpoints 2016-09-29 14:24:43 +02:00
Alejandro 2ac242795a Merge pull request #831 from taigaio/filter_fixes
Fix userstories filter data counters
2016-09-29 07:53:16 +02:00
David Barragán Merino fb562be12e Fix userstories filter data counters 2016-09-28 20:54:10 +02:00
David Barragán Merino 600392c3e1 Remove duplicate line 2016-09-28 13:56:00 +02:00
David Barragán Merino d05b3f197f Remove tags_color in superadmin panel to prevent some errors 2016-09-28 13:11:01 +02:00
David Barragán Merino 71a1069ec2 [i18n] Update locales 2016-09-28 10:30:51 +02:00
David Barragán Merino 1bf87ec469 Update CHANGELOG 2016-09-28 10:28:35 +02:00
David Barragán Merino 480e5a2c55 Merge pull request #830 from taigaio/Improving-default-values-for-orders
Improving default values for orders
2016-09-28 10:20:31 +02:00
Alejandro Alonso ec9cff8a88 Improving default values for orders 2016-09-28 09:56:12 +02:00
David Barragán Merino 4bece43bf8 Merge branch 'sanduhrs-webhooks' 2016-09-27 10:41:46 +02:00
Stefan Auditor e8dae79ce0 Rework webhook signature header to align with larger implementations and defined standards at https://superfeedr-misc.s3.amazonaws.com/pubsubhubbub-core-0.4.html\#authednotify 2016-09-27 10:41:04 +02:00
David Barragán Merino 3dd0e8fc79 Merge pull request #828 from taigaio/Improving-history-migration-0011
Improving history migration 0011
2016-09-27 09:50:39 +02:00
Alejandro Alonso dc623f5c5c Improving history migration 0011 2016-09-27 09:43:00 +02:00
David Barragán Merino aa0095ba58 Add missing migration 2016-09-27 09:42:28 +02:00
Alejandro Alonso ae0bc7ee88 Filter by epics 2016-09-27 08:59:33 +02:00
David Barragán Merino 19cd0c5354 Fix epic sort when 'order' is the same 2016-09-27 08:59:33 +02:00
David Barragán Merino 7e7c567709 Reorder and add some explanations 2016-09-26 11:55:36 +02:00
David Barragán Merino fe28a9ddf9 Fix tests 2016-09-23 10:04:53 +02:00
David Barragán Merino 1fb84e6b8d Add related user stories in CSV report for epics 2016-09-22 09:22:59 +02:00
Alejandro Alonso ddb0d733c4 Rendering properly epic links 2016-09-21 13:46:52 +02:00
Alejandro Alonso 9a06a8df94 Fixing tags actions with epics 2016-09-21 13:21:14 +02:00
David Barragán Merino f8a1c8f4a3 [i18n] Add norwegian Bokmal (nb) translation 2016-09-20 13:23:42 +02:00
David Barragán Merino ce0fcbaa2f [i18n] Update locales 2016-09-20 13:22:20 +02:00
Alejandro Alonso d3ede7fda2 Removing atomic transaction from load_dump command 2016-09-20 10:39:02 +02:00
Alejandro Alonso aff6f56cc0 Improving load_dump command 2016-09-20 07:47:40 +02:00
David Barragán Merino 195880767a Enable epics in all sample data projects and not created custom fields in empty projects 2016-09-19 18:28:19 +02:00
David Barragán Merino b8befbc28f Merge pull request #770 from taigaio/us/1563/epics
US #1563: Epics
2016-09-19 11:43:19 +02:00
Alejandro Alonso 128da54eb1 Removing json_build_object postgresql calls 2016-09-16 12:26:59 +02:00
Alejandro Alonso b0931e8f88 Rewriting attach_user_stories_counts_to_queryset without json_build_object 2016-09-16 12:03:12 +02:00
Alejandro Alonso 3b5b658f3c Fixing gogs integration 2016-09-15 14:20:40 +02:00
Alejandro Alonso a4c57a605b Fixing epic serialization 2016-09-15 14:18:00 +02:00
Alejandro Alonso 778bd60189 Epic support in webhooks 2016-09-15 13:29:10 +02:00
Alejandro Alonso 4e50135234 Support for updating epic status via commit message 2016-09-15 12:20:48 +02:00
Alejandro Alonso 564cd43504 Excluding epics_order from diffs 2016-09-13 15:19:30 +02:00
Alejandro Alonso 0b6a31271e Fixing HistoryEntry generation for epic changes 2016-09-13 15:15:05 +02:00
Alejandro Alonso 21a7ca3e4c Disabling epics module by default for new projects 2016-09-13 10:39:17 +02:00
Alejandro Alonso 8475015025 Adding timeline entries on bulk_create calls 2016-09-13 09:11:21 +02:00
Alejandro Alonso e9ca1abf55 Adding epics to user favorites and voted APIs 2016-09-12 15:34:15 +02:00
Alejandro Alonso db34ad32c9 Including epic in timelines 2016-09-12 14:10:50 +02:00
Alejandro Alonso 35b799e89d Adding color to epic freezer 2016-09-09 14:35:12 +02:00
Alejandro Alonso f2a800a099 Fixing issue on epic related userstories update 2016-09-08 15:12:25 +02:00
Alejandro Alonso b975a22859 Allow setting project when creating related user stories for epics in bulk mode 2016-09-08 11:16:53 +02:00
David Barragán Merino 68f6cf08b2 Add epics to the sitemap generator 2016-09-08 11:16:53 +02:00
Alejandro Alonso 3648043f37 Adding unique restriction for epics 2016-09-08 11:16:53 +02:00
Alejandro Alonso bf9aafaca3 Fixing HistoryEntry for epic edition 2016-09-08 11:16:53 +02:00
Alejandro Alonso df174230a4 Migration for adding epic status to existing projects 2016-09-08 11:16:53 +02:00
Alejandro Alonso 75ddf706ee Adding epic related userstories tests file 2016-09-08 11:16:53 +02:00
David Barragán Merino 9e609ee20a Disabled epics module by default in Project and ProjectTemplates 2016-09-08 11:16:52 +02:00
Alejandro Alonso 544cdc00d0 Adding permission tests for epic related user stories 2016-09-08 11:16:52 +02:00
David Barragán Merino 7313dfd996 Add comment permissions to default project templates 2016-09-08 11:16:52 +02:00
David Barragán Merino 5e1ca747d3 [i18n] Update locales 2016-09-08 11:16:52 +02:00
David Barragán Merino 8d0c9ee1c1 Fix test and RelatedUserStoyr API nested endpoint 2016-09-08 11:16:52 +02:00
David Barragán Merino 1cb9248912 Minor codee improvements 2016-09-08 11:16:52 +02:00
David Barragán Merino 275ce381f9 Fix tasks creation in bulk test 2016-09-08 11:16:52 +02:00
David Barragán Merino f7c74fc63e Fix some tests 2016-09-08 11:16:52 +02:00
David Barragán Merino 94ea299c39 Add epics info in user_story_extra_info in task serializer 2016-09-08 11:16:52 +02:00
David Barragán Merino e68079b769 Use new tags mixing in EpicSerializer 2016-09-08 11:16:52 +02:00
David Barragán Merino e03de182f3 Fix an entrophy ploblem with custom attributes for epics in sample data 2016-09-08 11:16:52 +02:00
David Barragán Merino 7611785c3b Add user_story_extra_info to task serializer 2016-09-08 11:16:52 +02:00
David Barragán Merino 4c6f49aaab Improve more validators 2016-09-08 11:16:52 +02:00
Alejandro Alonso e83e4b8beb Refactoring epics API 2016-09-08 11:16:52 +02:00
Alejandro Alonso 32267af4f4 Refactoring epics API 2016-09-08 11:16:52 +02:00
Alejandro Alonso 890c668e7e WIP: epics admin 2016-09-08 11:16:52 +02:00
David Barragán Merino 79f74135f7 Remove unneeded code 2016-09-08 11:16:52 +02:00
David Barragán Merino abff91e6bb Fix memeverships-bulk-create validator 2016-09-08 11:16:52 +02:00
David Barragán Merino bc69ecd886 Improve userstories.validators 2016-09-08 11:16:52 +02:00
Alejandro Alonso 3656acd7f3 Fixing tests 2016-09-08 11:16:52 +02:00
Alejandro Alonso 0e6daf09f6 Adding unset_related_userstory end point to epics API 2016-09-08 11:16:52 +02:00
David Barragán Merino 9bba8efde9 Fix tests 2016-09-08 11:16:52 +02:00
Alejandro Alonso 2f7384a76b Adding set_related_userstory end point to epics API 2016-09-08 11:16:52 +02:00
Alejandro Alonso 4d4f8a44a1 Removing the bulk update order for epics and doing that processing on the update 2016-09-08 11:16:52 +02:00
Alejandro Alonso 46f6fa71e6 Adding bulk_create_related_userstories endpoint to epics API 2016-09-08 11:16:52 +02:00
Alejandro Alonso dd3b098d4e Fixing _get_userstories_epics for projects without userstories 2016-09-08 11:16:52 +02:00
Alejandro Alonso 9d0e0180ef Import export including epics 2016-09-08 11:16:52 +02:00
David Barragán Merino 0ff7ce8975 Add is_closed to StatusEstraInfoSerializer 2016-09-08 11:16:52 +02:00
David Barragán Merino 783dca1472 Minor fixes 2016-09-08 11:16:52 +02:00
David Barragán Merino 133cf149fd Improve Epic sort feature 2016-09-08 11:16:52 +02:00
David Barragán Merino 3dbde420d8 Add missed migrations 2016-09-08 11:16:52 +02:00
David Barragán Merino 15aa7da858 Apply some fixes over epic custom attributes 2016-09-08 11:16:52 +02:00
David Barragán Merino e2f6245fbb Add epic order in userstories if filter by epic ide is enabled 2016-09-08 11:16:52 +02:00
David Barragán Merino d461b1962d Add epics to user stories serializers 2016-09-08 11:16:52 +02:00
David Barragán Merino b014c25454 Remove epic order from user story 2016-09-08 11:16:52 +02:00
David Barragán Merino f5f8f66b57 Add color to Epics 2016-09-08 11:16:52 +02:00
David Barragán Merino ff7d241a37 Filter userstories by epics 2016-09-08 11:16:52 +02:00
David Barragán Merino 5cda117c1b Remove deprecate code 2016-09-08 11:16:52 +02:00
David Barragán Merino fb673ab844 Ability to order stories inside an Epic 2016-09-08 11:16:52 +02:00
David Barragán Merino 9a1b422a42 Add project extra info to the user story serializer 2016-09-08 11:16:52 +02:00
David Barragán Merino d307318b90 Add user story counts in epic serializer 2016-09-08 11:16:52 +02:00
David Barragán Merino 5a5d393815 Add epic references signals 2016-09-08 11:16:52 +02:00
David Barragán Merino 0a5ba7b3ae Add csv for Epics 2016-09-08 11:16:52 +02:00
David Barragán Merino 79eeccf379 Add epic notifications 2016-09-08 11:16:52 +02:00
David Barragán Merino c3570e9446 Add test of epic history endpoint 2016-09-08 11:16:52 +02:00
David Barragán Merino d104e12b01 Add histori entries for epics 2016-09-08 11:16:52 +02:00
David Barragán Merino bb1a43e637 Fix print 2016-09-08 11:16:52 +02:00
David Barragán Merino 0d3de76c8e Fix resolve endpoint to work with epics 2016-09-08 11:16:52 +02:00
David Barragán Merino 5d5a42a077 Create voters and watcher for epics 2016-09-08 11:16:52 +02:00
David Barragán Merino f2bfa82c44 Fix sampledata 2016-09-08 11:16:52 +02:00
David Barragán Merino 0e2ba632db Add and fix some tests 2016-09-08 11:16:52 +02:00
David Barragán Merino a752c6b84f Add tests over Epic attachments 2016-09-08 11:16:52 +02:00
David Barragán Merino 1ae4e49246 Add Epics to taiga.searches 2016-09-08 11:16:52 +02:00
David Barragán Merino 7a412fb536 Fix some tests 2016-09-08 11:16:52 +02:00
David Barragán Merino 82bff6f5bf Fixup. Custom atributes 2016-09-08 11:16:52 +02:00
David Barragán Merino d5b2bc95ab Add initial Epic viewset (+ Voters and watchers) 2016-09-08 11:16:52 +02:00
David Barragán Merino 329a3e5ef3 Add default permissions 2016-09-08 11:16:52 +02:00
David Barragán Merino 6bdfe25503 Save related stories in history items for epics 2016-09-08 11:16:52 +02:00
David Barragán Merino 46006706c5 Add order attr for user stories relationships 2016-09-08 11:16:52 +02:00
David Barragán Merino a7c262ffdc Working in history and timeline for epics (initial version) 2016-09-08 11:16:52 +02:00
David Barragán Merino 389a18026b Epic custom attributes values 2016-09-08 11:16:52 +02:00
David Barragán Merino f70923c064 Initial epic model + epic status + epcic attachments + project template + project defaults 2016-09-08 11:16:52 +02:00
David Barragán Merino 75a9751136 Update CHANGELOG 2016-09-08 11:16:52 +02:00
David Barragán Merino 4a28721c73 Disable Add action in Memberships admin panel to prevent mistakes 2016-09-08 10:59:22 +02:00
David Barragán Merino 24a507b8e4 Merge pull request #818 from mjrk/feature/date-filters
Adds created-, modified-, finished- and finish_date filters to issues, tasks and userstories (if applicable)
2016-09-02 12:45:25 +02:00
Michael Jurke dfdea74c58 Add created-, modified- and finish_date filters to userstories 2016-09-02 11:02:04 +02:00
Michael Jurke 87f81154ec Add created-, modified- and finished_date filters to tasks 2016-09-02 10:50:47 +02:00
Michael Jurke 0ec1da600c Add tests for issues modified_date and finished_date 2016-09-02 01:30:45 +02:00
Michael Jurke cc055f2634 Update AUTHORS and CHANGELOG 2016-09-01 23:35:37 +02:00
Michael Jurke b7d8dbc1a7 Adds created-, modified-, finished- and finish_date to base filters
Extends issues api filters with created_date, modified_date and finished_date
2016-09-01 23:34:37 +02:00
David Barragán Merino c978676442 [Backport] Use postgresql 9.4 in TravisCI 2016-08-29 12:42:41 +02:00
David Barragán Merino c10ba11ace [Backport] Fix error when delete projects directly in the admin panel list 2016-08-29 12:36:39 +02:00
David Barragán Merino 2df813aeb9 Fix error when delete projects directly in the admin panel list 2016-08-29 12:35:31 +02:00
David Barragán Merino 9a2d88b940 Fix new-comment-permission migration 2016-08-25 12:31:27 +02:00
David Barragán Merino 6134d7303d Fix a typo 2016-08-24 18:08:01 +02:00
David Barragán Merino 54baf7b4dc Allow to edit tags and set no color 2016-08-23 13:58:58 +02:00
David Barragán Merino 534445b30c Fix some error messages 2016-08-23 13:26:58 +02:00
David Barragán Merino 8ac8fd4a62 [i18n] Update locales 2016-08-22 19:21:45 +02:00
David Barragán Merino 48d88cf987 Merge pull request #811 from taigaio/sorting-correctly-tasks-and-attachment
Sorting tasks and attachments inside us and tasks correctly
2016-08-21 10:35:33 +02:00
Jesús Espino adf964d0df Sorting tasks and attachments inside us and tasks correctly 2016-08-20 23:47:48 +02:00
David Barragán Merino b2a55d84f1 Use postgresql 9.4 in TravisCI 2016-08-20 23:47:27 +02:00
David Barragán Merino f20a9737a1 Merge pull request #804 from taigaio/Refactoring-tags-and-colors-in-API
Refactoring tags and colors in API
2016-08-17 11:52:25 +02:00
Alejandro Alonso 3c2e094e8f Refactoring-tags-and-colors-in-API 2016-08-17 11:51:55 +02:00
David Barragán Merino 9182227704 Merge pull request #806 from taigaio/bug/4493-id-on-priority-severity-etc
Bug#4493: Return id on points/priority/severity...
2016-08-17 11:49:33 +02:00
Jesús Espino f80c4cf90d Bug#4493: Return id on points/priority/severity... 2016-08-17 11:49:21 +02:00
David Barragán Merino 82657f51d3 Merge pull request #807 from taigaio/generate-api-doc
Fix small bugs found while generating api documentation
2016-08-17 11:48:38 +02:00
Jesús Espino 0e125d7342 Fix sample data to generate alwais the same data 2016-08-17 10:46:36 +02:00
Jesús Espino a6f5b4c0ec Fix small bugs found while generating api documentation 2016-08-17 10:46:27 +02:00
David Barragán Merino c414e6b9c4 Fix role serializer 2016-08-17 10:41:28 +02:00
David Barragán Merino 29a64d1243 Add role id to the members dict serializer 2016-08-16 14:33:08 +02:00
David Barragán Merino d7b9623450 Merge pull request #802 from taigaio/refactoring-bulk-update-milestone-api-call
Refactoring bulk update milestone API call
2016-08-03 14:09:05 +02:00
Alejandro Alonso cc01ff029c Refactoring bulk update milestone API call 2016-08-03 13:18:40 +02:00
Jesús Espino f78159e564 Small fix on get user story by ref 2016-08-03 08:47:07 +02:00
David Barragán Merino dd53c153c7 Merge pull request #803 from taigaio/small-bugfixes
Small bugfixes on bad requests
2016-08-02 18:45:41 +02:00
Jesús Espino 2d4ab32fb4 Small bugfixes on bad requests 2016-08-02 18:07:06 +02:00
David Barragán Merino baab2552ab Fix tests 2016-08-02 18:01:12 +02:00
David Barragán Merino 3187bdfed9 Fix tasks validators for bulk operations 2016-08-02 15:14:07 +02:00
David Barragán Merino d1f7158125 Fix bulk_update_orders for user stories 2016-08-02 13:27:56 +02:00
David Barragán Merino 73599c41ff [i18n] Update locales 2016-07-31 12:19:05 +02:00
David Barragán Merino 04fb04340a Prevent the creation of a duplicate gogs user if you have the gogs plugin enabled 2016-07-29 12:41:11 +02:00
David Barragán Merino ed69c48f73 Merge pull request #799 from taigaio/us/4445/add-milestones-to-project-detail
US#4445: Add milestones to project detail
2016-07-28 16:50:40 +02:00
Jesús Espino 0f15f671f5 US#4445: Add milestones to project detail 2016-07-28 16:50:18 +02:00
David Barragán Merino 0064e6e82a Merge pull request #783 from taigaio/fixing-issue-when-multiple-attachment-deletion
Removing unnecesary advisory_lock
2016-07-28 16:48:18 +02:00
Jesús Espino 3e9bfd7523 Fixing slug duplications on race conditions 2016-07-28 16:47:53 +02:00
Jesús Espino 5eb6bfe1e0 Only update tasks milestone when needed 2016-07-28 16:47:53 +02:00
Jesús Espino 5214717856 Fix some of the deadlocks on take_snapshot 2016-07-28 16:47:53 +02:00
Jesús Espino 0a900cc84d Fixed race condition on multiple attachment deletion 2016-07-28 16:47:53 +02:00
David Barragán Merino 340bc7670b Merge pull request #781 from taigaio/export-import-serializer-validator-separation
Migrating export_import api to new serializers/validators
2016-07-28 16:46:22 +02:00
Jesús Espino 1b6077c105 Migrating export_import api to new serializers/validators 2016-07-28 16:45:31 +02:00
David Barragán Merino 888162af63 Merge pull request #793 from taigaio/refactoring-bulk-update-order-api-calls
Refactoring bulk update order API calls
2016-07-28 16:44:34 +02:00
Alejandro Alonso f66b4c9640 Refactoring bulk update order API calls 2016-07-28 15:35:15 +02:00
David Barragán Merino 4c84aaa885 Merge pull request #782 from taigaio/hooks-refactor
Refactor Github/Gitlab/Bitbucket hooks
2016-07-28 14:43:03 +02:00
Jesús Espino a9d6624124 Add changelog entries 2016-07-28 14:06:18 +02:00
Jesús Espino c4ff960435 Add gogs integration inside taiga distribution 2016-07-28 14:06:18 +02:00
Jesús Espino 5856ad6410 Refactor bitbucket/github/gitlab hooks 2016-07-28 14:06:18 +02:00
Alejandro Alonso ed9698760c [Backport] Fixing custom fields deletes 2016-07-28 11:17:28 +02:00
David Barragán Merino 2a4cac4647 Merge pull request #798 from taigaio/issue/issue/deleting-custom-fields
Fixing custom fields deletes
2016-07-28 11:14:49 +02:00
Alejandro Alonso 1fb7d530bd Fixing custom fields deletes 2016-07-28 10:00:15 +02:00
Alejandro Alonso ecc4b97fa1 Adding id field to custom attribute serializer 2016-07-27 12:53:47 +02:00
Jesús Espino d6ec587bd5 [backport] Fix race condition on item creations and timeline inclusion 2016-07-22 12:49:00 +02:00
Alejandro aed0adfa38 Merge pull request #796 from taigaio/bug/userstories-in-timeline
Fix race condition on item creations and timeline inclusion
2016-07-22 12:46:47 +02:00
Jesús Espino 1842e3dd9b Fix race condition on item creations and timeline inclusion 2016-07-22 12:21:09 +02:00
David Barragán Merino bad32e5cba Pepocho 2016-07-22 10:53:52 +02:00
Alejandro Alonso 3c39c92e82 [Backport] Fixing webhooks description_diff 2016-07-22 09:33:29 +02:00
Alejandro Alonso d31c7b21d7 Fixing webhooks description_diff 2016-07-22 09:32:00 +02:00
Alejandro Alonso c68211250e Fixing webhook milestone serializer 2016-07-22 09:24:45 +02:00
Jesús Espino 4279ea9ec0 [Backport] Fix export test 2016-07-21 12:32:53 +02:00
Andrey Arapov a907bdab74 [Backport] Update bleach to 1.4.3 2016-07-21 12:18:02 +02:00
Alejandro Alonso e1bdb15710 Removing unnecesary code 2016-07-21 11:49:34 +02:00
Jesús Espino dde59e4b09 Merge pull request #791 from taigaio/Improving-HighLightedContentSerializer
Improving HighLightedContentSerializer and making more consistent how  the assigned_to extra info is shown
2016-07-20 12:43:44 +02:00
Alejandro Alonso 25c74cfb07 Improving HighLightedContentSerializer and making more consistent how the assigned_to extra info is shown 2016-07-20 09:08:30 +02:00
David Barragán Merino 2c5716a097 Fix more test 2016-07-18 13:00:29 +02:00
David Barragán Merino 9237cd0c00 Merge branch 'arno01-reqs' 2016-07-18 12:30:18 +02:00
Andrey Arapov 698b15722d Update bleach to 1.4.3 2016-07-18 12:29:45 +02:00
David Barragán Merino 86348b472f Fix tests 2016-07-18 12:12:29 +02:00
David Barragán Merino 5a6393ffab [Backport] Fix a typo 2016-07-08 20:38:15 +02:00
David Barragán Merino f62952ac00 Fix a typo 2016-07-08 20:37:43 +02:00
David Barragán Merino 70ba7af395 [Backport] Prevent accidental deletions of the database 2016-07-08 20:25:50 +02:00
David Barragán Merino f1a55e747d Remove a print 2016-07-08 20:25:01 +02:00
David Barragán Merino bbf0ea370e Prevent accidental deletions of the database 2016-07-08 20:16:49 +02:00
David Barragán Merino 750158a16b Merge pull request #784 from taigaio/search-into-tags
Search into tags on searches and filters
2016-07-08 13:32:14 +02:00
Jesús Espino 0b8eabef15 Adding weight to searches 2016-07-08 13:31:49 +02:00
Jesús Espino aad40e4ba0 Add to tags to base filters 2016-07-08 13:31:49 +02:00
Riccardo Coccioli 4257f6d5a0 Search also into tags fields
Changed the search queries to search also into the tags fields.
Fixes #276
2016-07-08 13:31:49 +02:00
David Barragán Merino bc3025f065 Merge pull request #453 from taigaio/filter-by-email-domain-on-register
Add filter by email domain on register
2016-07-08 13:04:04 +02:00
Jesús Espino e66b96376f Add filter by email domain on register 2016-07-08 13:03:38 +02:00
David Barragán Merino b0df33ed2e Merge pull request #772 from taigaio/remove-storage-path-call
Remove storage.path usage for allow other Storage Backends
2016-07-08 13:00:51 +02:00
Jesús Espino c110d6d1a2 Remove storage.path usage for allow other Storage Backends 2016-07-08 13:00:30 +02:00
Jesús Espino 6abac42047 Merge pull request #779 from taigaio/US/3873/users-empty-avatars
Including the gravatar id in the responses and not generating the gra…
2016-07-08 11:25:55 +02:00
Alejandro Alonso 20a7595ca3 Including the gravatar id in the responses and not generating the gravatar avatar url by default 2016-07-08 09:36:32 +02:00
Alejandro Alonso c3022f4f74 Fixing reduce_dim sql function 2016-07-07 13:09:03 +02:00
Alejandro 9911bec941 Merge pull request #778 from taigaio/fix-project-members-photo
Fix project members photo
2016-07-07 11:27:09 +02:00
Jesús Espino 8896d65136 Fix project members photo 2016-07-07 11:05:39 +02:00
David Barragán Merino df2f504125 Merge pull request #777 from taigaio/extra-api-migration
Extra api migration
2016-07-06 20:28:27 +02:00
Alejandro Alonso dd4a1cd9e7 Improving by_ref endpoints and allowing to use the project slug 2016-07-06 20:07:11 +02:00
Jesús Espino 9c8a630fc6 Moving ValidationError to taiga.base.exceptions 2016-07-06 20:07:11 +02:00
Jesús Espino 6e3eeb7cca Migrating custom fields serializer 2016-07-06 20:07:11 +02:00
Jesús Espino 81454426f9 Migrating auth serializers 2016-07-06 20:07:11 +02:00
Jesús Espino 8d86c42fa0 Migrating feedback serializers 2016-07-06 20:07:11 +02:00
Jesús Espino 04102e3b9f Migrating attachments serializers 2016-07-06 20:07:11 +02:00
Jesús Espino 4f5a4f1314 Migrating references validators 2016-07-06 12:46:53 +02:00
Jesús Espino a51ca8c85a Migrating Likes and votes serializers 2016-07-06 12:46:53 +02:00
Jesús Espino cbec0caca2 Migrating tagging validators 2016-07-06 12:46:53 +02:00
Jesús Espino 7d2b6c34ce Migrating users serializers and validators 2016-07-06 12:46:53 +02:00
Jesús Espino 39075288ac Migrating user storage 2016-07-06 12:46:53 +02:00
Jesús Espino d7a979d23c Migrating external apps 2016-07-06 12:46:53 +02:00
Alejandro Alonso 4864b9f957 Splitting validators and serializers 2016-07-06 12:46:53 +02:00
Alejandro Alonso 78a2118e8e API performance 2016-07-06 12:46:53 +02:00
David Barragán Merino 1252a08dbb Addd flake8 config file 2016-07-06 10:27:27 +02:00
David Barragán Merino ba66f3839b [i18n] Update locales 2016-07-03 23:49:29 +02:00
David Barragán Merino 9ecc7ccbfc Merge pull request #771 from taigaio/add-project-id-to-history-entries
Add project_id to all history entries
2016-07-01 10:16:42 +02:00
Jesús Espino 64d47aa61c Add project_id to all history entries 2016-07-01 10:16:21 +02:00
Jesús Espino 78e72c7488 Fix dependencies on migrations 2016-07-01 10:16:21 +02:00
David Barragán Merino d1411c2409 Bamedizing 2016-06-30 17:39:06 +02:00
Alejandro Alonso 713e7dffda Fixing MembersFilterBackend 2016-06-30 11:54:15 +02:00
David Barragán Merino 1ddb78c777 Merge pull request #767 from taigaio/enhancement/history-diffs
Compress diffs to show only the changes and some context
2016-06-29 19:00:54 +02:00
David Barragán Merino b80e4566f6 Compress diffs to show only the changes and some context 2016-06-29 16:18:32 +02:00
Jesús Espino b6839a9505 [Backport] Enhancement#4356: Add gzipped dumps import support 2016-06-28 09:33:11 +02:00
Alejandro 3cadc652ed Merge pull request #766 from taigaio/enhancement/4356/import-gzipped-jsons
Enhancement#4356: Add gzipped dumps import support
2016-06-28 09:30:59 +02:00
Jesús Espino 9709e6a259 Enhancement#4356: Add gzipped dumps import support 2016-06-28 09:12:57 +02:00
David Barragán Merino 941ab5bd9b Merge pull request #748 from taigaio/US/2928-cards-ui-refactor
US #2928: Cards UI refactor
2016-06-27 11:43:49 +02:00
David Barragán Merino 6b6f6e80be Add filter_data to tasks API endpoint 2016-06-27 10:45:32 +02:00
David Barragán Merino 4904e1859f Fix api calls from the front 2016-06-27 10:45:32 +02:00
David Barragán Merino c82288faa3 Fix tests, identations and pass the Flake8 2016-06-27 10:45:32 +02:00
Alejandro Alonso 13e0e79f44 Fixing filter_data endpoint for userstories and issues 2016-06-27 10:45:32 +02:00
Alejandro Alonso 34446d8289 Adding tasks and attachments to userstory listing API calls and attachments to task listing API call 2016-06-27 10:45:16 +02:00
Alejandro Alonso 4827df0058 Updating CHANGELOG.md 2016-06-23 18:24:35 +02:00
David Barragán Merino 2cb4ee6e6c Update CHANGELOG 2016-06-22 09:20:09 +02:00
Jesús Espino bde6f855ce Fix export test 2016-06-21 15:57:12 +02:00
Jesús Espino 63a3b573af TemporaryFix: change taiga.permissions.services to taiga.permissions.service 2016-06-21 15:08:03 +02:00
Jesús Espino 55d1b042b2 BugFix: use plain format dump by default on exports 2016-06-21 15:02:52 +02:00
Jesús Espino 8214027012 BugFix: use plain format dump by default on exports 2016-06-21 15:02:42 +02:00
Jesús Espino 765c15cd29 [Backport] Adding dump_project_async command 2016-06-21 11:53:41 +02:00
Jesús Espino a3f642d160 [Backport] Fixing timeline exportation 2016-06-21 11:53:38 +02:00
Jesús Espino 1ae1a18262 [Backport] Reestructure serializers module 2016-06-21 11:53:35 +02:00
Jesús Espino 520f383449 [Backport] Add gzip support to exports 2016-06-21 11:53:32 +02:00
Jesús Espino ed0a650dc9 [Backport] Improve performance on exports 2016-06-21 11:53:22 +02:00
Alejandro 089a864825 Merge pull request #760 from taigaio/export-performance
Improve export performance
2016-06-21 11:51:10 +02:00
Jesús Espino 773ab63106 Adding dump_project_async command 2016-06-21 11:18:46 +02:00
Jesús Espino 44d46ad47b Fixing timeline exportation 2016-06-21 11:18:46 +02:00
Jesús Espino 1fa5a12d06 Reestructure serializers module 2016-06-21 11:18:46 +02:00
Jesús Espino 1336f5c8e9 Add gzip support to exports 2016-06-21 11:18:46 +02:00
Jesús Espino b5202636e1 Improve performance on exports 2016-06-21 11:18:46 +02:00
Alejandro 9e9f2af52a Merge pull request #764 from taigaio/enhancement/wiki/create_page_when_create_link
Enhancement: Create the wiki page if not exist when new links are cre…
2016-06-21 11:17:44 +02:00
David Barragán Merino 549c022bf8 Add license disclaimer to some files 2016-06-21 11:00:02 +02:00
David Barragán Merino d59e90885c Enhancement: Create the wiki page if not exist when new links are created 2016-06-21 10:59:27 +02:00
David Barragán Merino e4f96e6053 Fix a typo 2016-06-17 17:04:39 +02:00
David Barragán Merino d62597c5ef Merge pull request #761 from taigaio/api-performance-1
Api performance
2016-06-17 12:43:25 +02:00
Alejandro Alonso 7968c80376 Improving API performance for us, task, milestone and issue listing 2016-06-17 12:42:21 +02:00
David Barragán Merino 117a97f12c Fix external_reference 2016-06-17 10:56:03 +02:00
David Barragán Merino a4f2493848 Issue #3964: Order project templates 2016-06-15 17:13:00 +02:00
David Barragán Merino ef0b7dfe64 Merge pull request #751 from taigaio/us/4302/improve_tagging_system_v2
US #4302 - Improve tagging system (v2)
2016-06-15 17:07:21 +02:00
David Barragán Merino 63cc560dab Change TextArrayField to ArrayField for tags, permisions and more fields. 2016-06-15 11:11:31 +02:00
David Barragán Merino bdd0f0b833 Fix to add tags in the same order 2016-06-15 11:03:29 +02:00
David Barragán Merino 93e30ceffa Fix sampledata command to generate tags with and without color 2016-06-15 11:03:29 +02:00
David Barragán Merino 13ef1b9af5 Move all tags code to projects.tags 2016-06-15 11:03:29 +02:00
Jesús Espino fde98473c4 Keep the to_tag color on mix_tags service function 2016-06-15 11:03:29 +02:00
Alejandro Alonso b4c81f9c9d Fixing sample_data 2016-06-15 11:03:28 +02:00
Alejandro Alonso 2b82bb056f Updating CHANGELOG 2016-06-15 11:03:28 +02:00
David Barragán Merino 8c45033f18 Assign a color when create a new tag 2016-06-15 11:03:28 +02:00
Alejandro Alonso 3e555de7c4 API calls to create, rename, edit color, delete and mix tags 2016-06-15 11:03:28 +02:00
Alejandro Alonso 7134d04262 Adding migrations 2016-06-15 11:03:28 +02:00
David Barragán Merino 20c350ea63 Remove obsolete code 2016-06-15 11:03:28 +02:00
David Barragán Merino 3080c0e5f2 Change default order for wiki links 2016-06-15 09:22:06 +02:00
Jesús Espino 0f7e25b870 [Backport] Marking as "html" safe email subjects 2016-06-07 19:14:51 +02:00
David Barragán Merino 9cb258bb80 Merge pull request #750 from taigaio/marking-as-safe-email-subjects
Marking as "html" safe email subjects
2016-06-07 19:13:33 +02:00
Jesús Espino edced6ed0e Marking as "html" safe email subjects 2016-06-07 19:12:49 +02:00
David Barragán Merino 59280bc936 Merge pull request #753 from taigaio/enhancement/3758/include-gravatar-url-into-users-serializer
Enhancement#3758: Include gravatar url into users serializer
2016-06-07 19:11:42 +02:00
Jesús Espino ccc6491c83 Enhancement#3758: Include gravatar url into users serializer 2016-06-07 19:11:29 +02:00
Jesús Espino f55ce1caab [Backport] Fix race condition on projects refresh totals 2016-06-07 13:06:08 +02:00
David Barragán Merino 109085618a Merge pull request #752 from taigaio/bug/race-condition-on-project-refresh-totals
Fix race condition on projects refresh totals
2016-06-07 13:04:42 +02:00
Jesús Espino 3fd332219c Fix race condition on projects refresh totals 2016-06-07 12:19:55 +02:00
David Barragán Merino 935347afaf Merge branch 'andela-ijubril-fix-repetition' 2016-06-06 12:09:06 +02:00
Jubril Issa 0418d1baf9 Remove repetition in code 2016-06-06 12:08:01 +02:00
Alejandro Alonso f27859af74 [Backport] Fixing situations where project owner is none 2016-06-03 08:42:56 +02:00
David Barragán Merino e7525c23ac Merge pull request #747 from taigaio/fixing-situations-where-project-owner-is-none
Fixing situations where project owner is none
2016-06-03 08:42:05 +02:00
Alejandro Alonso d83db761c9 Fixing situations where project owner is none 2016-06-03 08:40:17 +02:00
Alejandro Alonso aa9f62f9c3 [Backport] Detecting errors properly on points 2016-06-02 13:51:32 +02:00
David Barragán Merino 99ee766781 Merge pull request #745 from taigaio/detecting-errors-properly-on-points
Detecting errors properly on points
2016-06-02 13:41:23 +02:00
Alejandro Alonso f3176f4b5a Detecting errors properly on points 2016-06-02 11:53:09 +02:00
Alejandro Alonso eab03c54d5 [Backport] Including created, modified and finished dates in tasks csv reports 2016-06-01 10:45:11 +02:00
David Barragán Merino a7b3c3099c Merge pull request #743 from taigaio/dates-for-tasks-csv-reports
Including created, modified and finished dates in tasks csv reports
2016-06-01 10:42:33 +02:00
Alejandro Alonso b00ba4a968 Including created, modified and finished dates in tasks csv reports 2016-06-01 08:16:39 +02:00
David Barragán Merino 39615b2da8 [Backport] Fix migrations between master and stable 2016-05-31 14:00:57 +02:00
David Barragán Merino c9c66238bd regenerate merge migration 2016-05-31 14:00:20 +02:00
David Barragán Merino eb87f17d2e Fix migrations between master and stable 2016-05-31 13:54:41 +02:00
Alejandro Alonso b2525f959a [Backport] Fixing permission when project hasn't owner 2016-05-31 13:50:17 +02:00
Alejandro Alonso 513e62fb83 Fixing permission when project hasn't owner 2016-05-31 13:45:09 +02:00
Alejandro Alonso 51a673586a [Backport] Improving asynch timeline generation 2016-05-31 13:20:30 +02:00
David Barragán Merino 90cf09e30a Merge pull request #739 from taigaio/Improving-asynch-timeline-generation
Improving asynch timeline generation
2016-05-31 13:19:50 +02:00
Alejandro Alonso 6da3d8d30f Improving asynch timeline generation 2016-05-31 13:19:37 +02:00
Alejandro Alonso 2b9ddc27db [Backport] Improving project deletion 2016-05-31 13:18:12 +02:00
David Barragán Merino 868cc5fb8c Merge pull request #741 from taigaio/Improving-project-deletion
Improving project deletion
2016-05-31 13:17:24 +02:00
Alejandro Alonso 03674f8962 Improving project deletion 2016-05-31 13:11:44 +02:00
Alejandro Alonso fc20d6c8f5 [Backport] Issue 4257: Mutiple configured webhhoks trigger on the same url 2016-05-31 11:56:25 +02:00
David Barragán Merino 998022c3ba [Backport] Apply PEP-263 to taiga project 2016-05-31 11:56:15 +02:00
David Barragán Merino 84e2b90168 Merge pull request #740 from taigaio/issue/4257/Mutiple_configured_webhhoks_trigger_on_the_same_url
Issue 4257: Mutiple configured webhhoks trigger on the same url
2016-05-31 11:45:02 +02:00
Alejandro Alonso f3ae8c73e4 Issue 4257: Mutiple configured webhhoks trigger on the same url 2016-05-31 11:15:24 +02:00
Alejandro 2b28616ffb Merge pull request #738 from taigaio/issue/4258/use_pep_263
Apply PEP-263 to taiga project
2016-05-31 08:10:22 +02:00
David Barragán Merino 47907eedb4 Apply PEP-263 to taiga project 2016-05-30 20:41:40 +02:00
David Barragán Merino 3c15b0ab1a Create a merge migration to fix the problem between master and stable branches 2016-05-30 18:39:10 +02:00
David Barragán Merino 3fd2d1cade Fix a problem with a migration between master and stable branch 2016-05-30 18:35:23 +02:00
David Barragán Merino 42c7496bee Fix a problem with a migration between master and stable branch 2016-05-30 18:32:30 +02:00
Alejandro Alonso a5d4e3c495 [Backport] Improving-project-deletion 2016-05-30 17:58:47 +02:00
David Barragán Merino a1f52e9a72 Merge pull request #736 from taigaio/Improving-project-deletion
Improving-project-deletion
2016-05-30 17:57:57 +02:00
Alejandro Alonso 532d633467 Improving-project-deletion 2016-05-30 17:57:13 +02:00
Alejandro Alonso 7445e9ca72 [Backport] Generating application token only when it doesn't exist 2016-05-30 15:08:56 +02:00
Alejandro 29e6551663 Merge pull request #734 from taigaio/generating-application-token-only-when-it-doesn't-exist
Generating application token only when it doesn't exist
2016-05-30 15:08:12 +02:00
Alejandro Alonso 1556d45ae6 Generating application token only when it doesn't exist 2016-05-26 14:54:35 +02:00
David Barragán Merino d463a1e8af Merge pull request #730 from taigaio/adding-endpoint-to-bulk-update-milestone-for-user-stories
Adding endpoint to bulk updating the milestone for user stories
2016-05-26 12:15:39 +02:00
Alejandro Alonso b272472396 Adding endpoint to bulk updating the milestone for user stories 2016-05-26 12:12:24 +02:00
David Barragán Merino 43fafd1f57 Merge pull request #729 from taigaio/us/4186-2929/add_and_edit_comment_permission
US #4186 #2929: Add and edit comment permission
2016-05-26 11:02:09 +02:00
David Barragán Merino 413a83808a US #4186: Permission to add comments 2016-05-25 20:37:43 +02:00
David Barragán Merino 38e5198cc9 Minor refactor over permissions module 2016-05-25 20:37:04 +02:00
David Barragán Merino 591614e57a Remove USER_PERMISSIONS 2016-05-25 14:24:47 +02:00
Alejandro Alonso 81b41529d2 US #2929: Ability to edit commit and see their history 2016-05-25 14:24:00 +02:00
Alejandro Alonso 4539925251 [Backport] Fixing timeline permissions for admin and superusers 2016-05-25 11:02:54 +02:00
David Barragán Merino 4e8495a167 Merge pull request #728 from taigaio/fixing-timeline-permissions
Fixing timeline permissions for admin and superusers
2016-05-25 11:02:13 +02:00
Alejandro Alonso 827d1b6132 Fixing timeline permissions for admin and superusers 2016-05-25 11:01:56 +02:00
Alejandro Alonso 26c4b37493 [Backport] Ugly hack to temporary disable thumbnail generation for tiff files 2016-05-25 10:59:40 +02:00
David Barragán Merino aee1ee13d6 Merge pull request #732 from taigaio/ugly-hack-to-temporary-disable-tiff-thumbnails-generation
Ugly hack to temporary disable thumbnail generation for tiff files
2016-05-25 10:58:50 +02:00
Alejandro Alonso e295bd95d8 Ugly hack to temporary disable thumbnail generation for tiff files 2016-05-25 07:56:37 +02:00
David Barragán Merino f79a47fd24 [Backport] Fix support pages url 2016-05-24 14:18:36 +02:00
David Barragán Merino a7dfec1fc9 Fix support pages url 2016-05-24 14:17:52 +02:00
Alejandro Alonso 1dc8b193cf [Backport] Improving performance when updating objects 2016-05-13 09:52:15 +02:00
Alejandro Alonso e8bcc84b35 [Backport] Improving performance for history api 2016-05-13 09:51:55 +02:00
David Barragán Merino d30ee8873c Merge pull request #722 from taigaio/improving-performance-when-updating-objects
Improving performance when updating objects
2016-05-13 09:49:59 +02:00
Alejandro Alonso 4d1fb120b1 Improving performance when updating objects 2016-05-13 09:49:27 +02:00
David Barragán Merino b6e513e73b [Backport] Made minor fixes over load_dump and dump_project commands 2016-05-13 09:49:14 +02:00
Alejandro ab91c47781 Merge pull request #721 from taigaio/fix/load_and_dump_project_commands
Made minor fixes over load_dump and dump_project commands
2016-05-13 09:46:33 +02:00
David Barragán Merino 9474a1174f Made minor fixes over load_dump and dump_project commands 2016-05-13 09:00:39 +02:00
David Barragán Merino 7bbb90b61a Merge pull request #723 from taigaio/improving-performance-for-history-api
Improving performance for history api
2016-05-12 15:02:08 +02:00
Alejandro Alonso 85acb93e22 Improving performance for history api 2016-05-12 08:00:36 +02:00
David Barragán Merino 073e178747 [Backport] Fix error, import a bad model class 2016-05-09 13:51:17 +02:00
David Barragán Merino 576700afb6 Fix error, import a bad model class 2016-05-09 11:48:00 +02:00
David Barragán Merino 3134e9789a [Backport] Improve the import command 2016-05-06 16:43:18 +02:00
David Barragán Merino 9e897ca499 Improve the import command 2016-05-06 16:42:03 +02:00
David Barragán Merino 87af5188ad [Backport] Improve the logs when an importer process fail 2016-05-06 11:44:11 +02:00
Alejandro acebfda6b1 Merge pull request #716 from taigaio/improve_importer_logs
Improve the logs when an importer process fail
2016-05-06 11:43:32 +02:00
David Barragán Merino eac0ee89cd Improve the logs when an importer process fail 2016-05-06 10:38:04 +02:00
Alejandro Alonso eddf958256 [Backport] Import export projects with None as name for ProjectRelatedField 2016-05-05 13:39:14 +02:00
David Barragán Merino cf2af21d61 Merge pull request #714 from taigaio/Import-export-projects-with-None-as-name-for-ProjectRelatedField
Import export projects with None as name for ProjectRelatedField
2016-05-05 13:37:39 +02:00
Alejandro Alonso ec435f45bc Import export projects with None as name for ProjectRelatedField 2016-05-05 13:36:57 +02:00
David Barragán Merino c17522ecaf [Backport] Remove some unused vars 2016-05-05 13:32:35 +02:00
David Barragán Merino bdb5a433f8 Remove some unused vars 2016-05-05 13:32:06 +02:00
David Barragán Merino cebad9f335 [Backport] Fix issue #4151: @mentions with dashes doesn't work 2016-05-05 13:28:26 +02:00
David Barragán Merino 4516dbca49 Fix issue #4151: @mentions with dashes doesn't work 2016-05-05 13:27:40 +02:00
Jesús Espino d126e195d0 [Backport] Improve the project admin 2016-05-04 16:02:44 +02:00
David Barragán Merino 761b224a61 Merge pull request #711 from taigaio/improve-project-admin
Improve the project admin
2016-05-04 16:01:50 +02:00
Jesús Espino 2456c0454d Improve the project admin 2016-05-04 16:01:34 +02:00
David Barragán Merino 6735d50e90 [Backport] Fix error importing user stories with related issues 2016-05-03 20:58:53 +02:00
David Barragán Merino 8791d5d103 Fix error importing user stories with related issues 2016-05-03 20:57:44 +02:00
David Barragán Merino bfd10e7ec1 [Backport] Create actions to make projects public or private 2016-05-03 13:07:00 +02:00
David Barragán Merino a8d52cce01 Create actions to make projects public or private 2016-05-03 13:05:32 +02:00
David Barragán Merino 846e5d940d [Backport] Make is_private editable in the admin panel 2016-05-03 11:51:33 +02:00
David Barragán Merino af3fedee42 Make is_private editable in the admin panel 2016-05-03 11:51:01 +02:00
David Barragán Merino 78d4c5cd0e [Backport] [i18n] Update locales 2016-05-01 19:11:04 +02:00
David Barragán Merino 8cd6c28010 [i18n] Update locales 2016-05-01 19:10:28 +02:00
David Barragán Merino a949eda117 Improve projects admin panel 2016-04-30 16:24:40 +02:00
David Barragán Merino 66d5c372b2 Improve projects admin panel 2016-04-30 16:23:58 +02:00
Alejandro Alonso 334b1a23aa [Backport] Fixing load_dump command 2016-04-29 15:06:56 +02:00
Alejandro Alonso c34634b39a Fixing load_dump command 2016-04-29 15:06:37 +02:00
Alejandro Alonso e647fc8d19 Merge branch 'master' into stable 2016-04-29 10:45:42 +02:00
David Barragán Merino 041e0b6b0b Update CHANGELOG 2016-04-28 10:35:40 +02:00
Alejandro 22342878db Merge pull request #707 from taigaio/issue/4114/remove_incomplete_project_if_import_fail
Fix issue #4114: Remove incomplete project if import process fail (now-is-when version)
2016-04-26 08:32:39 +02:00
David Barragán Merino 0db559f9a9 Improve the command 'dump_project' 2016-04-26 08:09:53 +02:00
David Barragán Merino 283cf726b3 Fix issue #4114: Remove incomplete project if import process fail 2016-04-25 12:52:47 +02:00
David Barragán Merino 12b3998219 Fix CHANGELOR 2016-04-22 16:48:39 +02:00
Alejandro Alonso 2f01440c8f [Backport] Adding is_out_of_owner_limits to project detail serializer 2016-04-21 13:10:43 +02:00
David Barragán Merino 3c020d20b8 Merge pull request #705 from taigaio/adding-is_out_of_owner_limits-to-project-detail-serializer
Adding is_out_of_owner_limits to project detail serializer
2016-04-21 00:05:18 +02:00
Alejandro Alonso e7748cb236 Adding is_out_of_owner_limits to project detail serializer 2016-04-20 22:54:09 +02:00
Alejandro a992fe2704 Merge pull request #703 from taigaio/enhancement/featured_project_list_randomly_ordered
Get a randomized list of featured projects if discover mode is enabled
2016-04-20 10:49:37 +02:00
David Barragán Merino 19121220d6 Get a randomized list of featured projects if discover mode is enabled 2016-04-20 10:02:47 +02:00
Alejandro ecf5107818 Merge pull request #702 from taigaio/issue/4094/sprin
Fix issue #4094: Add 'estimated start' and 'estimated end' sprint dates to CSV reports
2016-04-20 10:01:39 +02:00
David Barragán Merino 0877a5af28 Fix issue #4094: Add 'estimated start' and 'estimated end' sprint dates to CSV reports 2016-04-20 09:26:47 +02:00
Alejandro 7495ecca9e Merge pull request #699 from taigaio/issue/3755/including_permalinks_in_webhooks
Improve webhooks data
2016-04-20 09:23:45 +02:00
David Barragán Merino 9f4886963a Improve webhooks (fix #3688, #3755 and #3758) 2016-04-20 09:08:00 +02:00
David Barragán Merino 40eaa7e119 Merge pull request #704 from taigaio/us/3903/show-sprint-in-search-results
US #3903: Sprint number/title column on search results for user stories
2016-04-19 16:49:46 +02:00
everblut 00852e2298 US #3903: Sprint number/title column on search results for user stories 2016-04-19 16:16:24 +02:00
David Barragán Merino b2ad16e591 [i18n] Update locales 2016-04-19 16:00:50 +02:00
David Barragán Merino 960cbfd55a Improve admin panel to list projects in user detail panel 2016-04-18 15:15:18 +02:00
David Barragán Merino 45d92669e3 Improve admin panel to list projects in user detail panel 2016-04-18 15:14:22 +02:00
David Barragán Merino 4174334982 [Backport] Fix import exception. 2016-04-15 12:10:21 +02:00
David Barragán Merino dbb59f74cc Fix import exception. 2016-04-15 12:08:46 +02:00
David Barragán Merino 50ac02fe34 [Backport] Fix and error when try to catch exceptions when fail the import process 2016-04-14 18:52:48 +02:00
David Barragán Merino e1d5bebd58 Fix and error when try to catch exceptions when fail the import process 2016-04-14 18:51:31 +02:00
David Barragán Merino 675d013474 Update CHANGELOG 2016-04-09 21:42:52 +02:00
Alejandro ba3d4488f1 Merge pull request #689 from taigaio/issue/4059/clean_users_role_permissions
Clean user role permissions: remove vote_issues in Role.permissions
2016-04-09 08:38:37 +02:00
David Barragán Merino 8773a5072c [Backport] Clean user role permissions: remove vote_issues in Role.permissions 2016-04-09 08:34:54 +02:00
David Barragán Merino 8664d781bb Clean user role permissions: remove vote_issues in Role.permissions 2016-04-09 08:01:33 +02:00
David Barragán Merino ced6f435c2 [Backport] Fix issue 4056, 4075 and a minor refactor 2016-04-08 14:00:24 +02:00
Alejandro 43e41edf0b Merge pull request #694 from taigaio/issues/4056-and-4075
Fix issue 4056, 4075 and a minor refactor
2016-04-08 13:59:13 +02:00
David Barragán Merino e84015e48e Fix issue 4056, 4075 and a minor refactor 2016-04-08 13:24:14 +02:00
Alejandro Alonso 47be184901 [Backport] Allowing export projects even if any attachment doesn't exist in the storage 2016-04-08 12:36:38 +02:00
David Barragán Merino dd4fc1b351 Merge pull request #693 from taigaio/Allowing-export-project-even-if-any-file-doesnt-exist
Allowing export projects even if any attachment doesn't exist in the …
2016-04-08 12:22:36 +02:00
Alejandro Alonso 440b4e7936 Allowing export projects even if any attachment doesn't exist in the storage 2016-04-08 11:49:36 +02:00
David Barragán Merino 4e3c4aa62d [Backport] Fix issue #4058: Remove memberships of deleted users 2016-04-07 08:45:04 +02:00
Alejandro 2946394b7c Merge pull request #692 from taigaio/issue/4058/remove_memberships_of_cancelled_accounts
Fix issue #4058: Remove memberships of deleted users
2016-04-07 08:44:13 +02:00
David Barragán Merino 53b480c127 Fix issue #4058: Remove memberships of deleted users 2016-04-06 19:18:25 +02:00
David Barragán Merino 472b8df982 [Backport] Fix issue #4061: Invalid error when try to add more memberships 2016-04-05 19:35:53 +02:00
David Barragán Merino 157c9d45e0 Fix issue #4061: Invalid error when try to add more memberships 2016-04-05 19:33:00 +02:00
David Barragán Merino 1f6382a09e Issue #4044: I can import featured projects into Taiga, and they become featured 2016-04-01 14:13:20 +02:00
David Barragán Merino f89bfab55c Fix tests about bitbucket integration 2016-04-01 12:46:52 +02:00
Alejandro Alonso 3aed6371ff Merge branch 'master' into stable 2016-04-01 11:25:44 +02:00
David Barragán Merino c5371a603a [i18n] Update locales 2016-04-01 11:10:23 +02:00
David Barragán Merino 9a92683637 Update CHANGELOG 2016-04-01 11:09:10 +02:00
David Barragán Merino 0f415d506f Fix a typo 2016-04-01 11:06:20 +02:00
David Barragán Merino bca10ae245 Bitbucket webhooks 💩 💩 2016-04-01 10:34:27 +02:00
Jesús Espino 28efb6dd68 Merge pull request #680 from taigaio/issue/4032/change_privacity_validation_error
Fix issue #4032: Wrong validation when change the project privacity
2016-03-31 08:53:47 +02:00
David Barragán Merino eaaad06313 Fix issue #4032: Wrong validation when change the project privacity 2016-03-31 08:55:53 +02:00
Jesús Espino c80d165b6f Merge pull request #678 from taigaio/issue/3995/remove_safe_filter_in_emails
Fix issue #3995: remove safe filter in emails to escape the content o…
2016-03-30 17:12:36 +02:00
David Barragán Merino ab42be4205 Fix issue #3995: remove safe filter in emails to escape the content of emails 2016-03-30 17:14:29 +02:00
Alejandro Alonso 6aecf282d1 Updating translations 2016-03-30 13:06:58 +02:00
Alejandro Alonso fab3c1f199 moving total_memberships to project detail serializer 2016-03-30 12:35:08 +02:00
David Barragán Merino 7c505b70d9 Make contrib plugins compatible with django 1.9 2016-03-30 11:14:23 +02:00
Alejandro Alonso 5e51ed4ee5 Updating project-admin url for taiga-front 2016-03-30 11:00:17 +02:00
David Barragán Merino 0eb73ea07c Fix lisence text 2016-03-30 09:17:23 +02:00
David Barragán Merino 878f2773f2 Merge pull request #679 from taigaio/signalkraft-enhancement/usermodel
Refactored occurrences of users.User to get_user_model(), which allowsa custom user model
2016-03-29 19:34:01 +02:00
Philipp Dörner a1bd320542 Refactored occurrences of users.User to get_user_model(), which allows a custom user model 2016-03-29 19:16:44 +02:00
Alejandro Alonso 9f8a6aa4f5 Fixing project transfer accept 2016-03-29 13:05:57 +02:00
David Barragán Merino d80f15b4ee Fix transfer emails templates 2016-03-29 12:12:37 +02:00
David Barragán Merino e5e61911ae [i18n] update locales 2016-03-29 11:09:19 +02:00
David Barragán Merino 893275e101 Merge pull request #676 from taigaio/check-max-owner-memberships-when-creating-invitations
Checking max owner memberships when creating invitations
2016-03-28 13:02:45 +02:00
Alejandro Alonso cab5543d44 Checking max owner memberships when creating invitations 2016-03-28 13:02:26 +02:00
David Barragán Merino a404cf9184 Fix text of seme emails 2016-03-28 12:53:39 +02:00
Alejandro Alonso 2b6678da0e Fixing transfering email 2016-03-28 09:44:08 +02:00
David Barragán Merino 0183e56638 [i18n] Update locales 2016-03-27 13:05:56 +02:00
David Barragán Merino f8cb6d9033 [i18n] Update locales 2016-03-25 12:21:32 +01:00
David Barragán Merino 995c753a4b Issue #225 (taiga-payments): Remove blocked project from discover calls 2016-03-23 13:52:11 +01:00
David Barragán Merino 5b61586925 Add missed migration 2016-03-22 13:00:55 +01:00
David Barragán Merino c29f1a5324 Fix is_admin validation for memberships without user 2016-03-22 10:31:21 +01:00
David Barragán Merino 5468d0ed34 Fix is_project_owner 2016-03-18 19:58:28 +01:00
Alejandro b1b339630b Merge pull request #671 from taigaio/fix/project_owners_cannot_be_no_admin
Project owners can not be no admin
2016-03-18 12:06:58 +01:00
David Barragán Merino f675cea441 Fix: reverse error messages 2016-03-18 11:00:38 +01:00
David Barragán Merino af588be527 Project owners can not be no admin 2016-03-18 09:37:01 +01:00
Alejandro 5ccb7a2702 Merge pull request #670 from taigaio/fix/transfer_project_to_no_admin_members
Transfer project ownership to non-admin members too
2016-03-18 09:33:09 +01:00
David Barragán Merino 11b6cc061c Transfer project ownership to no admin members too 2016-03-18 09:28:21 +01:00
Alejandro 2fd0a19743 Merge pull request #669 from taigaio/fix/move-can_is_private_be_updated-to-is_private_extra_info
Move 'can_is_private_be_updated' to 'is_private_extra_info'
2016-03-18 09:27:49 +01:00
David Barragán Merino 239c556ff5 Move 'can_is_private_be_updated' to 'is_private_extra_info' 2016-03-17 17:16:12 +01:00
Alejandro 0d5bb234f4 Merge pull request #666 from taigaio/fix/project-detail-serializer-and-user-restrictions
Add 'max_memberships', 'total_memberships' and 'can_is_private_be_updated' to the project serializer
2016-03-17 10:02:02 +01:00
David Barragán Merino f502a538c2 Add 'max_memberships', 'total_memberships' and 'can_is_private_be_updated' to the project serializer 2016-03-16 17:29:30 +01:00
Alejandro 2176e9a0af Merge pull request #665 from taigaio/fix/change-max_members-to-max_memberships-in-user-model
Change max_members_*_projects to max_memberships_*_projects
2016-03-16 11:38:50 +01:00
David Barragán Merino 13c8c6c42d Change max_members_*_projects to max_memberships_*_projects 2016-03-16 11:03:07 +01:00
Jesús Espino 84a819b447 Merge pull request #660 from taigaio/adding-transfer-validate-token-endpoint-to-the-API
Adding transfer_validate_token endpoint to projects API
2016-03-16 10:38:03 +01:00
Alejandro Alonso 97a45c7095 Adding transfer_validate_token endpoint to projects API 2016-03-16 09:18:43 +01:00
Alejandro Alonso d55b078cc2 Fixing burndown graph 2016-03-14 15:12:30 +01:00
David Barragán Merino 8b998a5b08 Merge pull request #659 from taigaio/issue-3950-fixing-burndown-points
Fixing burndown graph
2016-03-14 15:09:00 +01:00
Alejandro Alonso 765a31f5cb Fixing burndown graph 2016-03-14 14:48:10 +01:00
Alejandro Alonso 058948ee73 Adding extra reason to block project 2016-03-14 09:24:19 +01:00
David Barragán Merino 7dcf9c53ad :burn: :burn: 2016-03-09 18:02:14 +01:00
Alejandro Alonso 840c67358d [Backport] Removing unnecesary flush and gc collects from export task 2016-03-08 21:43:35 +01:00
Alejandro Alonso a9c8989f02 Removing unnecesary flush and gc collects from export task 2016-03-08 21:12:44 +01:00
David Barragán Merino c2323c2ad7 [i18n] Update locales 2016-03-08 18:28:30 +01:00
Alejandro Alonso 709bee710e [Backport] Fixing memory leak on export related to timeline 2016-03-08 16:03:41 +01:00
David Barragán Merino 006a7944ef Merge pull request #656 from taigaio/fixing-memory-leak-on-export-related-to-timeline
Fixing memory leak on export related to timeline
2016-03-08 16:02:58 +01:00
Alejandro Alonso 8c82eda1be Fixing memory leak on export related to timeline 2016-03-08 16:02:38 +01:00
David Barragán Merino 000490bbc0 Revert "Add django-redis"
This reverts commit 702c306ad7.
2016-03-08 15:14:20 +01:00
David Barragán Merino b68935fa1d Revert "[Backport] Add django-redis"
This reverts commit d656458372.
2016-03-08 15:13:38 +01:00
David Barragán Merino d656458372 [Backport] Add django-redis 2016-03-07 17:16:34 +01:00
David Barragán Merino 3348254a76 Merge pull request #654 from taigaio/redis-cache
Add django-redis
2016-03-07 17:14:27 +01:00
David Barragán Merino 702c306ad7 Add django-redis 2016-03-07 17:13:58 +01:00
Alejandro Alonso d8c9720103 Fixing mdrender import 2016-03-03 12:32:57 +01:00
Alejandro cc4f82f7cd Merge pull request #652 from taigaio/luyikei-avoid-none
Avoid accessing an attribute of a NoneType object
2016-03-03 10:06:08 +01:00
David Barragán Merino 973c5fe027 Merge pull request #648 from taigaio/generating-blocked-projects-on-sample-data
Generating blocked projects on sample data
2016-03-03 10:02:54 +01:00
Alejandro Alonso 348375a92d Generating blocked projects on sample data 2016-03-03 10:02:33 +01:00
luyikei 8d4bd9d655 Avoid accessing an attribute of a NoneType object 2016-03-03 09:20:01 +01:00
Alejandro 3c33c4e7cc Merge pull request #651 from taigaio/luyikei-missing-import-http404
Luyikei missing import http404
2016-03-03 09:17:47 +01:00
Alejandro Alonso 2b3bd1e4bc Updating AUTHORS.rst 2016-03-03 08:34:12 +01:00
luyikei 63eaa8f3c2 Fix missing import of Http404 2016-03-03 08:33:40 +01:00
Alejandro Alonso c267ff63a4 Updating AUTHORS.rst 2016-03-03 08:30:16 +01:00
Alejandro 6b2f8b1993 Merge pull request #650 from taigaio/gam-phon-master
usage of cached_property
2016-03-03 08:27:41 +01:00
Yaser Alraddadi 6c63d02b17 usage of cached_property 2016-03-03 08:22:20 +01:00
Alejandro Alonso 11a116029a Adding project_blocked_code to any element watched, liked or voted 2016-03-02 13:18:06 +01:00
Alejandro Alonso 375ec1c935 Fixing watched, like and vote queries 2016-03-02 12:18:56 +01:00
Jesús Espino bcb8f4d0ed [Backport] Add owner to the read-only fields on issues, tasks, wiki pages and user stories 2016-03-01 20:13:31 +01:00
David Barragán Merino beb824ab21 Merge pull request #644 from taigaio/bug/disallow-owner-modification-on-api-requests
Add owner to the read-only fields on issues, tasks, wiki pages and us…
2016-03-01 20:12:18 +01:00
Jesús Espino 7f7a092b25 Add owner to the read-only fields on issues, tasks, wiki pages and user stories 2016-03-01 16:16:17 +01:00
David Barragán Merino 66b3e76a70 Set total milestone and us points to None if backlog_module is disabled 2016-03-01 15:13:40 +01:00
David Barragán Merino db140f908b Merge pull request #643 from taigaio/Adding-blocked-code-project-info-to-watched-like-and-voted
Adding blocked code project info to watched like and voted
2016-03-01 13:24:59 +01:00
Alejandro Alonso 432966a378 Adding blocked code project info to watched like and voted 2016-03-01 12:53:09 +01:00
David Barragán Merino 993ac01505 Merge pull request #642 from taigaio/Adding-project-info-on-slots
Adding project info on about slots when import/create/edit fails
2016-03-01 12:52:35 +01:00
Alejandro Alonso 2457e8b705 Adding project info on about slots when import/create/edit fails 2016-03-01 12:23:07 +01:00
Alejandro e4ba94f67f Merge pull request #634 from taigaio/adding-owner-info-to-project-serializer
Adding owner info to project serializer
2016-02-29 15:09:54 +01:00
Alejandro Alonso c92dda9ed0 Adding owner info to project serializer 2016-02-29 13:16:31 +01:00
Alejandro Alonso 4c8a515004 [Backport] Fixing travis 2016-02-29 13:03:57 +01:00
David Barragán Merino f0b27620e2 Merge pull request #640 from taigaio/fixing-travis
Fixing travis
2016-02-29 13:02:46 +01:00
Alejandro Alonso 486b03e668 Fixing travis 2016-02-29 12:56:01 +01:00
David Barragán Merino b2e7b5c84a Merge pull request #632 from taigaio/refactor-owner-admin
Refactoring code parts where owner really means admin
2016-02-24 14:41:00 +01:00
Alejandro Alonso 22d545ebd4 Refactoring code parts where owner really means admin 2016-02-24 07:57:09 +01:00
David Barragán Merino 096f1458a6 [Backport] Fix a problem with mandrill email backend (the good solution) 2016-02-23 15:10:58 +01:00
David Barragán Merino a94c1ce58b Fix a problem with mandrill email backend (the good solution) 2016-02-23 15:10:06 +01:00
David Barragán Merino 334282f263 [Backport] Fix a problem with mandrill email backend 2016-02-23 12:32:27 +01:00
David Barragán Merino 190fa3d676 Fix a problem with mandrill email backend 2016-02-23 12:31:52 +01:00
David Barragán Merino 381e0b005d [Backport] Add missing import sentence of 'sys.path' 🎩 2016-02-23 08:23:12 +01:00
David Barragán Merino 3a6568e6bc Add missing import sentence of 'sys.path' 🎩 2016-02-22 17:17:17 +01:00
Bruno a727b79ed3 [Backport] make directory absolute 2016-02-22 10:09:11 +01:00
Alejandro c56021848d Merge pull request #631 from taigaio/bclermont-master
make directory absolute
2016-02-22 10:07:28 +01:00
Bruno 5ef1b7d2f3 make directory absolute 2016-02-22 10:06:52 +01:00
David Barragán Merino 186eab2610 [i18n] Update locales 2016-02-19 17:25:35 +01:00
Jesús Espino 8f55c5217c Merge pull request #623 from taigaio/refactor/is_owner_to_is_admin
Change membership.is_owner to membership.is_admin
2016-02-17 21:38:12 +01:00
David Barragán Merino cc8e5f39b7 Change membership.is_owner to membership.is_admin 2016-02-17 19:21:13 +01:00
Alejandro Alonso 96596dcc3e [Backport] Issue 3905: Usernames with dashes in them can't be @mentioned. 2016-02-17 11:16:58 +01:00
David Barragán Merino 9bdc00a109 Merge pull request #625 from taigaio/issue-3905-usernames-with-dashes-in-them-cant-be-@mentioned
Issue 3905: Usernames with dashes in them can't be @mentioned.
2016-02-17 11:16:12 +01:00
Alejandro Alonso 2c7de59ff8 Issue 3905: Usernames with dashes in them can't be @mentioned. 2016-02-17 11:15:57 +01:00
Alejandro Alonso 6da600e559 Fixing attachments with long names 2016-02-17 11:05:10 +01:00
David Barragán Merino 318995d7a7 Merge pull request #624 from taigaio/fixing-attachments-with-long-names
Fixing attachments with long names
2016-02-17 10:59:27 +01:00
Alejandro Alonso 26d10ca7a3 Fixing attachments with long names 2016-02-17 10:55:03 +01:00
Alejandro Alonso 8d2a4afe2a [Backport] Importing valid project without slug 2016-02-16 19:36:07 +01:00
David Barragán Merino c1c7e69f4d Merge pull request #607 from taigaio/import-project-without-slug
Importing valid project without slug
2016-02-16 19:31:55 +01:00
Alejandro Alonso deb668d74f Importing valid project without slug 2016-02-16 18:01:56 +01:00
Alejandro Alonso 91697207cb Fixing deadlock and condition race errrors 2016-02-15 16:12:13 +01:00
David Barragán Merino 099fae2c42 Merge pull request #619 from taigaio/fixing-deadlock-and-condition-race-errors
Fixing deadlock and condition race errrors
2016-02-15 16:03:03 +01:00
Alejandro Alonso 6553ad34e4 Fixing deadlock and condition race errrors 2016-02-15 15:18:27 +01:00
David Barragán Merino 3b9975351c Merge pull request #621 from AmiZya/url-from-future-deprecation
Removed 'load url from future' for compatibility with Django 1.9
2016-02-14 00:05:34 +01:00
Amine Zyad c22036f4c6 Removed 'load url from future' for compatibility with Django 1.9 2016-02-13 21:52:22 +00:00
Alejandro 47f6c03aa4 Merge pull request #610 from taigaio/upgrade/django-1.9
Upgrade to django 1.9
2016-02-12 14:19:29 +01:00
David Barragán Merino 7b7548b47d Update django to 1.9 and the rest of requirements 2016-02-11 19:35:29 +01:00
David Barragán Merino e1fe52639b Fix test 2016-02-10 22:17:00 +01:00
Alejandro Alonso c44852b6be [Backport] Status and default status can be None 2016-02-10 20:47:09 +01:00
David Barragán Merino 010fcfa635 Merge pull request #609 from taigaio/status-and-default_status-can-be-None
Status and default status can be None
2016-02-10 20:45:54 +01:00
Alejandro Alonso dba0597c9c Status and default status can be None 2016-02-10 20:45:20 +01:00
Alejandro Alonso 2e54452f08 [Backport] Fixing update_projects_order_in_bulk to check the memberships exist 2016-02-10 20:42:05 +01:00
David Barragán Merino db6b00ae67 Merge pull request #615 from taigaio/fix-sorting-projects-if-project-doesnt-exist
Fixing update_projects_order_in_bulk to check the memberships exist
2016-02-10 20:41:06 +01:00
Alejandro Alonso 6edaeeae66 Fixing update_projects_order_in_bulk to check the memberships exist 2016-02-10 20:40:36 +01:00
Alejandro Alonso b74f226a8a [Backport] Fixing bad origin configuration for gitlab and bitbucket 2016-02-10 20:39:11 +01:00
David Barragán Merino 029bf43c01 Merge pull request #614 from taigaio/fixing-bad-valid-origin-configuration-for-gitlab-and-bitbucket
Fixing bad origin configuration for gitlab and bitbucket
2016-02-10 20:36:37 +01:00
Alejandro Alonso f183640e33 Fixing bad origin configuration for gitlab and bitbucket 2016-02-10 20:36:14 +01:00
Alejandro Alonso b48d514271 [Backport] Fixing gitlab requests with empty payloads 2016-02-10 20:35:06 +01:00
David Barragán Merino fd0d30dfc9 Merge pull request #613 from taigaio/fixing-gitlab-empty-payloads
Fixing gitlab requests with empty payloads
2016-02-10 20:33:56 +01:00
Alejandro Alonso a206d41ba1 Fixing gitlab requests with empty payloads 2016-02-10 20:33:29 +01:00
Alejandro Alonso 1cf3aa22cd [Backport] Detecting invalid values when filtering by watchers 2016-02-10 20:32:08 +01:00
David Barragán Merino 800d4d398a Merge pull request #612 from taigaio/filtering-watchers-value-errors
Detecting invalid values when filtering by watchers
2016-02-10 20:31:14 +01:00
Alejandro Alonso 02013f6222 Detecting invalid values when filtering by watchers 2016-02-10 20:30:56 +01:00
Alejandro Alonso b1f6bc80d7 [Backport] Fixingon_new_history_entry signals 2016-02-10 20:29:50 +01:00
David Barragán Merino b5d20ca043 Merge pull request #611 from taigaio/Fixing-on_new_history_entry-signals
Fixingon_new_history_entry signals
2016-02-10 20:28:42 +01:00
Alejandro Alonso 52a497eb6c Fixingon_new_history_entry signals 2016-02-10 20:26:04 +01:00
David Barragán Merino e26f3d1657 Merge pull request #617 from taigaio/removed-rest-framework-deprecated-decorators
Remove rest framework deprecated decorators
2016-02-10 20:19:11 +01:00
Jesús Espino e43ea107ed Remove rest framework deprecated decorators 2016-02-10 19:45:34 +01:00
David Barragán Merino 7df6450fae Fix sample_data command 2016-02-10 16:24:07 +01:00
David Barragán Merino cafd9be2c9 Remove some prints 2016-02-09 18:37:23 +01:00
David Barragán Merino 6aabd1a3cd [Backport] Issue #3886: Fix empty full_names in Story and Issues filter lists 2016-02-09 11:21:11 +01:00
Alejandro fa0499ec6a Merge pull request #606 from taigaio/issue/3886/multiple_unassigned_in_filter_lists
Issue #3886: Fix empty full_names in Stories and Issues filter lists
2016-02-09 11:20:27 +01:00
David Barragán Merino c3c06bebe5 Issue #3886: Fix empty full_names in Story and Issues filter lists 2016-02-08 19:33:37 +01:00
David Barragán Merino e26189bf64 Merge pull request #605 from taigaio/fixes-on-transfer-project-amils
Fixe transfer project emails template and text
2016-02-08 19:33:15 +01:00
Jesús Espino b271d0ce47 Fixe transfer project emails template and text 2016-02-08 19:33:00 +01:00
David Barragán Merino cb253f7b48 Add some missed migrations 2016-02-08 18:53:24 +01:00
David Barragán Merino 9cb18f333f Merge pull request #604 from taigaio/astagi-feature/urlcustomfield
New custom field type: URL #862
2016-02-08 17:36:09 +01:00
Andrea Stagi 55a1a261f4 Add new custom attribute type: URL 2016-02-08 17:34:47 +01:00
Alejandro Alonso 7ec0ecfc33 Fixing blocked by owner leave error message 2016-02-08 14:12:58 +01:00
Alejandro Alonso e8bd1f8e6b Fixing project delete precondition 2016-02-08 14:12:11 +01:00
Alejandro Alonso 68eb66ce24 [Backport] Fixing serializers validation for duplicated names in priorities, severities and issue types 2016-02-05 13:05:55 +01:00
Alejandro Alonso 56734ec014 [Backport] Improving CSV reports performance 2016-02-05 13:05:34 +01:00
Jesús Espino 17923c6cfc Merge pull request #600 from taigaio/Fixing-serializers-validation-for-duplicated-names-in-priorities-severities-and-issue-types
Fixing serializers validation for duplicated names in priorities, sev…
2016-02-05 12:41:47 +01:00
Alejandro Alonso 6cf3c5727e Fixing serializers validation for duplicated names in priorities, severities and issue types 2016-02-05 12:43:46 +01:00
Jesús Espino 77379d98ed Merge pull request #601 from taigaio/improving-csv-reports-performance
Improving CSV reports performance
2016-02-05 12:40:24 +01:00
Alejandro Alonso 172ce73007 Improving CSV reports performance 2016-02-05 12:39:28 +01:00
Alejandro Alonso 14bdf47442 Updating CHANGELOG: including max projects and memberships feature 2016-02-05 11:35:11 +01:00
Alejandro Alonso f8f0967b8e Updating CHANGELOG: including transfer projects feature 2016-02-05 11:32:44 +01:00
David Barragán Merino 79ea56b64a Merge pull request #599 from taigaio/transfer-project
Adding transfer_token to project model
2016-02-05 09:43:11 +01:00
Alejandro Alonso 57cf32c56d Adding transfer_token to project model 2016-02-04 19:52:30 +01:00
David Barragán Merino 04a2cc71d1 Merge pull request #589 from taigaio/max-projects-per-user
Max projects per user
2016-02-04 18:13:10 +01:00
Jesús Espino 9fd896c948 Adding limit for user max memberhips for projects 2016-02-04 17:45:16 +01:00
Jesús Espino 6fbf81c3d6 Including max_public_projects and max_private_projets in importing process 2016-02-04 17:45:16 +01:00
Alejandro Alonso b8fd768d01 Adding max_private_projects and max_public_projects support 2016-02-04 17:45:16 +01:00
Alejandro Alonso 273d94f347 Updating CHANGELOG: including blocking projects feature 2016-02-04 15:18:08 +01:00
Alejandro Alonso 8ec29cfb55 [Backport] Trying to fix random signal errors 2016-02-04 15:03:00 +01:00
Alejandro Alonso b0a02ba401 Trying to fix random signal errors 2016-02-04 15:02:40 +01:00
David Barragán Merino 57b9f68c5d Update CHECKOUT 2016-02-03 13:29:21 +01:00
Alejandro Alonso 4b776355ab [Backport] Fixing duplicated wiki page slugs 2016-02-03 11:02:57 +01:00
David Barragán Merino 54ffb8fdca Merge pull request #596 from taigaio/fix-duplicated-wiki-page-slugs
Fixing duplicated wiki page slugs
2016-02-03 11:02:08 +01:00
David Barragán Merino 05fa97998f [Backport] Fix #3846: Exclude private projects in discover calls 2016-02-03 10:48:03 +01:00
David Barragán Merino a47f1240cd [Backport] Issue #3856: Show if I am a member of a project 2016-02-03 10:45:45 +01:00
Alejandro Alonso 22993203e8 Fixing duplicated wiki page slugs 2016-02-03 08:36:47 +01:00
Alejandro c9ff7287d1 Merge pull request #595 from taigaio/issue/3856/show_if_i_am_a_meber
Issue #3856: Show if I am a member of a project
2016-02-03 08:02:49 +01:00
Alejandro 04591e8d42 Merge pull request #593 from taigaio/issue/3846/exclude_invisible_projects_in_discover_section
Fix #3846: Exclude private projects in discover calls
2016-02-03 07:58:38 +01:00
David Barragán Merino be0f5d3706 Issue #3856: Show if I am a member of a project 2016-02-02 20:44:08 +01:00
David Barragán Merino b8acb0d51e Fix #3846: Exclude private projects in discover calls 2016-02-02 19:57:51 +01:00
Jesús Espino e5f4c2e9c2 Merge pull request #590 from taigaio/blocking-projects
Blocking projects
2016-02-02 16:42:49 +01:00
Alejandro Alonso 1f1b1b605a Blocking projects when users cancelling accounts 2016-02-02 16:44:47 +01:00
Alejandro Alonso a263e79e39 Controlling blocked projects for github, gitlab and bitbucket hooks 2016-02-02 16:44:47 +01:00
Alejandro Alonso 53ad5fb9fc Excluding blocked projects from sitemap 2016-02-02 16:44:47 +01:00
Alejandro Alonso 5b39052ca2 Blocking projects: updating project model and related viewsets 2016-02-02 16:44:47 +01:00
David Barragán Merino 159f02c3bd Update service.py 2016-02-02 16:36:35 +01:00
Jesús Espino fc26c4f03e Merge pull request #591 from taigaio/owner-must-be-a-valid-member-of-a-project
When leaving a project or removing a membership the project must allw…
2016-02-02 14:39:50 +01:00
Alejandro Alonso e15e00336d When leaving a project or removing a membership the project must allways have a valid owner 2016-02-02 14:23:44 +01:00
Alejandro Alonso 5899a63912 [Backport] Issue 3842: Catch properly invalid IP's errors for integrations 2016-02-01 11:35:50 +01:00
David Barragán Merino 835865fc83 Merge pull request #587 from taigaio/Issue-3842-Catch-properly-invalid-IPs-errors-for-integrations
Issue 3842: Catch properly invalid IP's errors for integrations
2016-02-01 11:34:15 +01:00
Alejandro Alonso d4f34b6554 Issue 3842: Catch properly invalid IP's errors for integrations 2016-02-01 11:31:27 +01:00
David Barragán Merino 630a3e88aa [Backport] Add discover url to the sitemap 2016-02-01 11:22:44 +01:00
David Barragán Merino 4ce824223f Add discover url to the sitemap 2016-02-01 11:22:07 +01:00
David Barragán Merino 50924e4410 [Backport] Fix #3831 2016-01-30 15:45:21 +01:00
David Barragán Merino f1e4e82109 Fix #3831 2016-01-30 15:44:05 +01:00
David Barragán Merino 2ac01c0d54 Merge branch 'master' into stable 2016-01-29 10:42:06 +01:00
David Barragán Merino b86b790261 [i18n] Update locales 2016-01-29 10:22:19 +01:00
David Barragán Merino 22dd0aee85 Update CHANGELOG 2016-01-26 15:05:31 +01:00
David Barragán Merino c7e104c2e0 [i18n] Update locales 2016-01-26 14:56:32 +01:00
David Barragán Merino d555637418 Update CHANGELOG 2016-01-26 12:26:46 +01:00
David Barragán Merino 49d90d4289 [i18n] Add turkish lang 2016-01-26 12:24:32 +01:00
David Barragán Merino fcb337a392 [i18n] Add swedish lang 2016-01-26 12:19:43 +01:00
Alejandro Alonso 2aa76adabc [Backport] Issue 3783: Hooks origin ips configuration allowing networks 2016-01-25 11:22:18 +01:00
David Barragán Merino 8bf4e0a019 Merge pull request #582 from taigaio/Issue-3783-hooks-origin-ips-configuration-allowing-networks
Issue 3783: Hooks origin ips configuration allowing networks
2016-01-25 11:20:03 +01:00
Alejandro Alonso 4b37dc413e Issue 3783: Hooks origin ips configuration allowing networks 2016-01-25 08:43:38 +01:00
David Barragán Merino eaabde1153 [i18n] Update locales 2016-01-23 20:27:18 +01:00
David Barragán Merino 74b7d6c34c [i18n] Update locales 2016-01-22 13:10:40 +01:00
David Barragán Merino 5a55eae85e Merge pull request #573 from taigaio/Issue-3641-back-joining-milestone-task-change-and-the-next-change
Issue 3641: taiga-back joins milestone task change and the next task change
2016-01-22 11:17:24 +01:00
Alejandro Alonso 915557bbb4 Issue 3641: taiga-back joins milestone task change and the next task change 2016-01-22 10:46:53 +01:00
David Barragán Merino 8530276a54 Merge pull request #572 from taigaio/Issue-3183-Error-when-uploading-an-avatar-with-a-name-of-254
Issue 3183: Error when uploading an image (as attachment) with a name of 254 chars
2016-01-22 10:25:45 +01:00
Alejandro Alonso 59d05a3d7e Issue 3183: Error when uploading an image (as attachment) with a name of 254 chars 2016-01-22 10:02:01 +01:00
David Barragán Merino 54423c29c2 Merge pull request #576 from taigaio/Improving-memberships-serialization
Improving membership serialization
2016-01-22 09:56:38 +01:00
Alejandro Alonso 9e5e1eb1aa Improving membership serialization 2016-01-22 09:36:59 +01:00
David Barragán Merino 50189afc38 Merge pull request #530 from taigaio/us/2127/discover
US #2127 Discover
2016-01-21 19:43:05 +01:00
David Barragán Merino 919a770fea Update CHANGELOG 2016-01-21 18:52:23 +01:00
Alejandro Alonso 1a341f7252 Fixing bug in get_total_closed_milestones 2016-01-21 18:44:18 +01:00
David Barragán Merino 2a970c0205 Fix some license messages 2016-01-21 18:44:18 +01:00
David Barragán Merino 19bbe1c512 Task #3716: [/api/v1/stats/discover] Show stats for discover secction 2016-01-21 18:44:18 +01:00
Alejandro Alonso 3d3e8f2d49 Adding logo_small_url to user likes and watches APIs 2016-01-21 18:44:18 +01:00
David Barragán Merino c280898642 Task #3623: Add looking_for_people_note field 2016-01-21 18:44:18 +01:00
David Barragán Merino ab56f1a772 Task #3526: Filter projects by text query (order by ranking name > tags > description 2016-01-21 18:44:18 +01:00
David Barragán Merino f61a811fd1 Task #3602: Order project list alphabetically by default 2016-01-21 18:44:18 +01:00
David Barragán Merino 0b7fe02a6f Task #3515: Add logo field to project model 2016-01-21 18:44:18 +01:00
Alejandro Alonso 50e00b6d45 Task #3517 #3516: Order by fans and activity (last week/moth/year/all time) 2016-01-21 18:44:18 +01:00
Alejandro Alonso 8aebfa4bae Task #3517: Add total_fans order by to projects API 2016-01-21 18:44:18 +01:00
Alejandro Alonso 0956fac835 Task #3523 #3524 #3525 #3532: Adding basic filtering by: is_looking_for_people, is_featured, is_backlog_activated and is_kanban_activated 2016-01-21 18:44:18 +01:00
Alejandro Alonso 5b2430ad69 Task #3520: Add is_looking_for_people field to project model 2016-01-21 18:44:17 +01:00
David Barragán Merino 806821469b Task #3531: Add is_featured field to project model 2016-01-21 18:44:17 +01:00
Alejandro Alonso 305cb5cd61 Fixing get projects watched by user calculation 2016-01-12 10:04:25 +01:00
David Barragán Merino f7137864de Add a link to our CoC 2016-01-11 10:43:32 +01:00
David Barragán Merino d4f205e1e4 Update TravisCI config file 2016-01-09 16:02:14 +01:00
Alejandro Alonso 0be73d6290 [Backport] Issue 3543 - Webhooks: problem extracting the story points from a user story 2016-01-08 16:27:54 +01:00
David Barragán Merino 3a57d9ce59 Merge pull request #566 from taigaio/Issue-3543-Webhooks-problem-extracting-the-story-points-from-a-user-story
Issue 3543 - Webhooks: problem extracting the story points from a user story
2016-01-08 16:26:13 +01:00
Alejandro Alonso 93376a5fbb Issue 3543 - Webhooks: problem extracting the story points from a user story 2016-01-08 16:25:03 +01:00
David Barragán Merino ea842a0c56 Merge pull request #568 from taigaio/license-preamble-improvements
License preamble improvements
2016-01-08 15:40:12 +01:00
Andrey Antukh 11b0051e1e Add alejandro.alonso copyright preamble to js sources. 2016-01-08 16:11:03 +02:00
Andrey Antukh f44414055d Add alejandro.alonso copyright preamble to the settings source files. 2016-01-08 16:09:24 +02:00
Andrey Antukh 9c4472a787 Add alejandro.alonso copyright preamble to test sources. 2016-01-08 16:08:46 +02:00
Andrey Antukh fe30371e2c Add alejandro.alonso copyright preamble to main python sources. 2016-01-08 16:06:57 +02:00
Andrey Antukh 028e45fa5e Add proper drf license preamble on related source files. 2016-01-08 15:58:30 +02:00
Andrey Antukh 8e2db6ce7a Fix my email on AUTHORS.rst file. 2016-01-08 15:58:30 +02:00
Andrey Antukh 327f6590ba Fix my email on copyright preamble on settings source files. 2016-01-08 15:58:30 +02:00
Andrey Antukh 501145bdcd Fix my email on copyright preamble on test source files. 2016-01-08 15:58:30 +02:00
Andrey Antukh 2ad5fda864 Fix my email on copyright preamble on main source files. 2016-01-08 15:58:24 +02:00
David Barragán Merino 5c5ce487b6 Update CHANGELOG 2016-01-07 11:19:24 +01:00
David Barragán Merino 7c8763cf5c Merge pull request #563 from taigaio/Fixng-error-messages-when-creating-membership-for-existing-user-in-the-project
Fixing error message when creating membership for existing user in th…
2016-01-07 11:13:25 +01:00
Alejandro Alonso 9d26fa86ff Fixing error message when creating membership for existing user in the project 2016-01-07 11:12:52 +01:00
David Barragán Merino 13e1d65e44 Merge branch 'master' into stable 2016-01-05 11:22:00 +01:00
David Barragán Merino d817f19c71 [i18n] Update locales 2016-01-05 11:11:53 +01:00
David Barragán Merino f30d455ee9 Update CHANGELOG 2016-01-05 08:37:36 +01:00
David Barragán Merino 32602a9e56 Merge pull request #537 from taigaio/fix-neighbor-null-value
Not existing neighbor return None, not empty dict
2016-01-04 17:58:25 +01:00
Jesús Espino ae65db65b0 Not existing neighbor return None, not empty dict 2016-01-04 17:35:13 +01:00
David Barragán Merino 8445510d2e Merge pull request #560 from taigaio/adding-command-to-send-notification-messages
Adding command to send notification messages
2016-01-04 17:29:42 +01:00
Alejandro Alonso 7eb138c200 Adding command to send notification messages 2016-01-04 17:29:11 +01:00
David Barragán Merino 5b83e8c450 Merge pull request #559 from taigaio/issue-3282-error-500-when-deleting-project-from-admin
Issue #3283: Taiga 1.8.0: HTTP error 500 while trying to delete proje…
2016-01-04 14:43:36 +01:00
Alejandro Alonso 93412840c9 Issue #3283: Taiga 1.8.0: HTTP error 500 while trying to delete project as admin. 2016-01-04 14:25:08 +01:00
David Barragán Merino a28b04a154 Merge pull request #558 from taigaio/issue-3492-search-fails-when-using-quotation-marks
Issue #3492: Search fails if using quotating marks
2016-01-04 14:22:53 +01:00
Alejandro Alonso 4ea2262400 Issue #3492: Search fails if using quotating marks 2016-01-04 13:58:59 +01:00
David Barragán Merino b619248cfe Merge pull request #557 from taigaio/Enhancement/3307/improve-sprint-burndown-graph
Improving milestone stats API
2016-01-04 13:57:38 +01:00
Alejandro Alonso a4172012ba Improving milestone stats API 2016-01-04 10:19:49 +01:00
David Barragán Merino b142cafc14 Update changelog 2016-01-04 08:51:06 +01:00
David Barragán Merino f992d372df Update license message 2016-01-04 08:51:06 +01:00
David Barragán Merino 66fa39bd0c Merge branch 'SamuelMarks-master' 2015-12-23 10:09:21 +01:00
David Barragán Merino fb11864f98 Merge branch 'master' of git://github.com/SamuelMarks/taiga-back into SamuelMarks-master 2015-12-23 10:08:22 +01:00
Xavier Julián 7e23b5978f Logo color is blurry 2015-12-23 09:11:58 +01:00
Alejandro Alonso bff7fe580f [Backport] Fixing delete project dump asynch task 2015-12-22 14:04:34 +01:00
David Barragán Merino a64a94b162 Merge pull request #551 from taigaio/fixing-delete-project-dump-asynch-task
Fixing delete project dump asynch task
2015-12-22 14:03:52 +01:00
Samuel Marks 03a5b5f39c Upgraded lxml from 3.5.0b1 to 3.5.0 2015-12-22 13:03:32 +11:00
Alejandro Alonso 73912e6128 Fixing delete project dump asynch task 2015-12-21 14:11:13 +01:00
David Barragán Merino 7141339a43 Update requirements 2015-12-20 19:22:14 +02:00
Alejandro Alonso 15d8793fe3 [Backport] Improving milestones API a bit more 2015-12-18 09:21:52 +01:00
Alejandro Alonso 1f8ef9bec3 Improving milestones API a bit more 2015-12-18 09:20:48 +01:00
Alejandro Alonso 4ffc983e77 [Backport] Improving milestones API 2015-12-17 10:11:19 +01:00
Alejandro Alonso 8d241479fa Improving milestones API 2015-12-17 10:10:55 +01:00
Alejandro Alonso afb5af1527 Improving timeline API performance 2015-12-13 22:24:11 +01:00
Alejandro Alonso 19f6f7f2b1 Improving timeline API performance 2015-12-13 22:22:24 +01:00
Alejandro Alonso b75937942d [Backport]Fixing attach_watchers_attrs_to_queryset method 2015-12-12 21:00:27 +01:00
Alejandro Alonso 9ecf762e11 Fixing attach_watchers_attrs_to_queryset method 2015-12-12 21:00:09 +01:00
David Barragán Merino 56432f3df2 [Backport] Add 'x-lazy-pagination' to COORS_ALLOWED_HEADERS 2015-12-11 13:25:17 +01:00
David Barragán Merino fefd0b06d3 Add 'x-lazy-pagination' to COORS_ALLOWED_HEADERS 2015-12-11 13:13:29 +01:00
Alejandro Alonso 09726402ad [Backport] Adding only relevant filter to timeline API 2015-12-11 13:04:47 +01:00
David Barragán Merino 29143fbd62 Merge pull request #546 from taigaio/adding-only_relevant-filter-to-timeline-API
Adding only relevant filter to timeline API
2015-12-11 13:03:26 +01:00
Alejandro Alonso a7c60fd1b3 Adding only relevant filter to timeline API 2015-12-11 13:00:16 +01:00
Alejandro Alonso 5bf1036d2a [Backport] Improving neighbor calculation 2015-12-11 12:55:09 +01:00
David Barragán Merino a103de351a Merge pull request #545 from taigaio/Improving-neighbor-calculation
Improving neighbor calculation
2015-12-11 12:52:58 +01:00
Alejandro Alonso 067ce86478 Improving neighbor calculation 2015-12-11 11:48:43 +01:00
David Barragán Merino 38f3ae0d8f Update CHANGELOG 2015-12-09 12:40:35 +01:00
David Barragán Merino 1a1afa0d0f [Backport] Task #3538: Add tribe_gig PickledObjectField attribute to UserStory model 2015-12-09 12:35:22 +01:00
David Barragán Merino 97edb6e3fb Merge pull request #536 from taigaio/task/3538/add_tribe_git_field_to_user_stories
Task #3538: Add tribe_gig PickledObjectField attribute to UserStory model
2015-12-09 12:07:45 +01:00
David Barragán Merino 987ca8c373 Use UserStorySerializer instead MilestoneUserStorySerializer 2015-12-08 20:59:34 +01:00
David Barragán Merino 935046fae2 Use UserStorySerializer instead MilestoneUserStorySerializer 2015-12-08 20:59:03 +01:00
David Barragán Merino cc9a52a82c [Backport] fix issue #3630: I cannot open a story from the taskboard when I click on the story title. 2015-12-08 20:37:21 +01:00
David Barragán Merino 818c8b4381 fix issue #3630: I cannot open a story from the taskboard when I click on the story title. 2015-12-08 20:36:48 +01:00
Alejandro Alonso 86b4384e8e [Backport] Improving API performance 2015-12-08 17:23:51 +01:00
David Barragán Merino 77077284fe Merge pull request #539 from taigaio/Improving-API-performance
Improving API performance
2015-12-03 00:54:30 +01:00
Alejandro Alonso e977c82427 Improving API performance 2015-12-02 19:55:25 +01:00
David Barragán Merino 325e3060be Remove deprecated documentation 2015-12-02 10:20:07 +01:00
David Barragán Merino 3df824fad5 Protected issue and task CSV export if owner in None 2015-12-01 21:01:52 +01:00
David Barragán Merino ed8ebfa354 Merge branch 'allistera-fix-csv-export' 2015-12-01 20:56:56 +01:00
Allister Antosik 45f20b6e64 Protected US CSV export assignment against undefined property 2015-12-01 20:56:31 +01:00
David Barragán Merino fd12f84969 Task #3538: Add tribe_gig PickledObjectField attribute to UserStory model 2015-11-30 14:56:00 +01:00
David Barragán Merino 3ba759e5d1 Remove duplicate code 2015-11-25 17:13:35 +01:00
Alejandro Alonso cff78589de Fixing sample data 2015-11-19 07:48:55 +01:00
David Barragán Merino cd45aa5cbf Fix some imports mistakes 2015-11-18 17:33:45 +01:00
David Barragán Merino 9c0cae8909 [Backport] Fix sample_data command 2015-11-18 16:57:03 +01:00
David Barragán Merino 8c3b3d640f Fix sample_data command 2015-11-18 16:56:32 +01:00
Alejandro 49bf85c498 Merge pull request #529 from taigaio/adding-card-thumbnail-to-attachments
Adding card thumbnail to attachments
2015-11-18 08:56:33 +01:00
Alejandro Alonso b3b18fa49f Adding card thumbnail to attachments 2015-11-18 08:17:40 +01:00
David Barragán Merino b2a31e8f92 [Backport] Fix TypeErrors: sequence item expected str, None found (ex: ','.join([None, 'a', 'b'])) 2015-11-18 08:10:53 +01:00
Alejandro 60db3b53c3 Merge pull request #514 from taigaio/issue/fix-emails
Fix TypeErrors: sequence item expected str instance, NoneType found
2015-11-18 08:09:35 +01:00
David Barragán Merino cf717055ac Fix TypeErrors: sequence item expected str, None found (ex: ','.join([None, 'a', 'b'])) 2015-11-17 18:39:56 +01:00
Alejandro Alonso 4f2b19dd74 [Backport] Enabling lowercase for username or email when allowed 2015-11-17 18:03:45 +01:00
David Barragán Merino 14fc5f35d2 Merge pull request #528 from taigaio/Enabling-lowercase-for-username-or-email-when-allowed
Enabling lowercase for username or email when allowed
2015-11-17 18:02:35 +01:00
David Barragán Merino 9d7adea9e2 Update CHANGELOG 2015-11-17 18:01:50 +01:00
Alejandro Alonso a427114762 Enabling lowercase for username or email when allowed 2015-11-17 18:01:50 +01:00
Alejandro Alonso eba2a3bff5 [Backport] Improving the stats API performance 2015-11-16 18:34:18 +01:00
David Barragán Merino 731b5902fd Merge pull request #523 from taigaio/improving-project-stats-api
Improving the stats API performance
2015-11-16 18:18:09 +01:00
Alejandro Alonso b041f2cfba Update CHANGELOG 2015-11-16 17:37:15 +01:00
Alejandro Alonso ad47f8f0c9 Improving the stats API performance 2015-11-16 17:35:48 +01:00
Alejandro Alonso fd8b0f21df [Backport] Fixing admin errors and making it usable again 2015-11-13 14:27:04 +01:00
David Barragán Merino 674b83c1a0 Update CHANGELOG 2015-11-13 14:25:54 +01:00
David Barragán Merino 9821d2ec8f Merge pull request #524 from taigaio/fixing-admin-errors-and-making-it-usable-again
Fixing admin errors and making it usable again
2015-11-13 14:16:54 +01:00
Alejandro Alonso a283c27a78 Fixing admin errors and making it usable again 2015-11-13 14:15:05 +01:00
David Barragán Merino 8ea91e4b38 Add travis_retry command 2015-11-13 13:40:59 +01:00
David Barragán Merino 7a68ee59c4 [Backport] Calculate average for last five working days 2015-11-12 11:33:07 +01:00
David Barragán Merino 6073a66333 Calculate average for last five working days 2015-11-12 11:28:17 +01:00
David Barragán Merino 9007a4680f [Backport] [i18n] Update locales 2015-11-11 16:05:42 +01:00
Alejandro Alonso e348cf34b8 []Backport Fixing chunk deserializing 2015-11-11 16:05:22 +01:00
David Barragán Merino 463f5af330 [i18n] Update locales 2015-11-11 16:04:30 +01:00
David Barragán Merino e518e25e6a Merge pull request #521 from taigaio/fixing-chunk-deserializing
Fixing chunk deserializing
2015-11-11 16:00:36 +01:00
Alejandro Alonso c8ae1b84dc Fixing chunk deserializing 2015-11-11 15:59:44 +01:00
David Barragán Merino d3c4c72261 [Backport] Update markdown lib 2015-11-10 16:06:45 +01:00
David Barragán Merino 89625c566a [Backport] Downgrade Pillow to fix a bug with tiffs images. And update some libs too 2015-11-10 16:06:27 +01:00
David Barragán Merino 1c384949ae Update markdown lib 2015-11-10 15:51:40 +01:00
David Barragán Merino 1602fb8219 Downgrade Pillow to fix a bug with tiffs images. And update some libs too 2015-11-10 15:49:34 +01:00
Alejandro Alonso 9db6653007 [Backport] Issue 3468: Export project then import destroyed the attachments 2015-11-10 15:08:55 +01:00
David Barragán Merino af2dae5f3b Merge pull request #518 from taigaio/issue-3468-export-import-project-break-attachments
Issue 3468: Export project then import destroyed the attachments
2015-11-10 14:38:35 +01:00
Alejandro Alonso 15536f1ce3 Issue 3468: Export project then import destroyed the attachments 2015-11-10 13:24:07 +01:00
David Barragán Merino 95e8af279e Merge pull request #515 from andela-ijubril/readme-edit
Update README.md
2015-11-06 10:29:44 +01:00
Issa Jubril 7ec5499a19 Update README.md
Change trasnlate to translate in README file
2015-11-06 10:17:27 +01:00
Alejandro Alonso 455a9f3b4f [backport] Fixing webhooks serializers 2015-11-06 07:49:34 +01:00
Alejandro Alonso 31ce792f41 Fixing webhooks serializers 2015-11-06 07:49:10 +01:00
David Barragán Merino b03ac82ee4 Update README.md 2015-11-05 18:57:20 +01:00
Alejandro Alonso 6e41bcdb7a [Backport] Setting finished date correctly on tasks 2015-11-04 19:25:57 +01:00
David Barragán Merino 25e0dc91a4 Merge pull request #511 from taigaio/Issue/3448/finished-date-not-set-correctly-in-tasks
Setting finished date correctly on tasks
2015-11-04 19:24:40 +01:00
Alejandro Alonso 195c62f9ba Setting finished date correctly on tasks 2015-11-04 19:21:58 +01:00
David Barragán Merino f13c1cea4e [Backport] Fix #3451, set 'involved' as default notify level (II) 2015-11-04 17:43:43 +01:00
David Barragán Merino 06e5492d66 Fix #3451, set 'involved' as default notify level (II) 2015-11-04 17:43:03 +01:00
David Barragán Merino b94be34dd9 [Backport] Fix #3451, set 'involved' as default notify level 2015-11-04 17:29:46 +01:00
David Barragán Merino d94a568ffb Fix #3451, set 'involved' as default notify level 2015-11-04 16:52:48 +01:00
Alejandro 6a64554ca7 Merge pull request #509 from taigaio/libs/update-redis
Update redis lib to 2.10.5
2015-11-04 10:25:39 +01:00
Alejandro Alonso 710e1cb6af [Backport] Fixing ts_query function 2015-11-04 10:14:26 +01:00
David Barragán Merino ed483e9970 Merge pull request #510 from taigaio/Issue/3445/to_tsquery-function-not-working-properly
Fixing ts_query function
2015-11-04 10:13:01 +01:00
Alejandro Alonso 448cc19185 Fixing ts_query function 2015-11-04 09:04:07 +01:00
David Barragán Merino fd300b5897 Update redis lib to 2.10.5 2015-11-03 18:32:37 +01:00
David Barragán Merino 752fb6888b [Backport] [HOTFIX] Fix last migrationm 2015-11-03 12:08:06 +01:00
David Barragán Merino b7a752221f [HOTFIX] Fix last migrationm 2015-11-03 12:07:03 +01:00
Alejandro Alonso 7745093f21 [backport] Fixing closed_points stats 2015-11-03 12:01:28 +01:00
Alejandro Alonso 26e4941c56 Fixing closed_points stats 2015-11-03 12:01:07 +01:00
Alejandro Alonso be46fac954 [Backport] Adding dates to csv issues report 2015-11-03 11:05:41 +01:00
David Barragán Merino 650f4d7431 Update CHANGELOG 2015-11-03 11:04:47 +01:00
David Barragán Merino 8b73716377 Merge pull request #506 from taigaio/Adding-dates-to-csv-issues-report
Adding dates to csv issues report
2015-11-03 11:04:15 +01:00
Alejandro Alonso 2bacb2de22 Adding dates to csv issues report 2015-11-03 11:01:15 +01:00
David Barragán Merino 4919ef51a5 [Backport] Create missing migration in taiga.projects.notifications 2015-11-03 10:55:48 +01:00
David Barragán Merino 7c6077e107 Create missing migration in taiga.projects.notifications 2015-11-03 10:55:19 +01:00
Alejandro Alonso 931a6942ab [Backport] Issue 3427: fix failing searchs containing : 2015-11-03 10:07:29 +01:00
David Barragán Merino 911bf4dd95 Merge pull request #505 from taigaio/issue/3427/some-searchs-are-failing
Issue 3427: fix failing searchs containing :
2015-11-03 10:06:16 +01:00
Alejandro Alonso bd83aa64ea Issue 3427: fix failing searchs containing : 2015-11-03 10:05:55 +01:00
David Barragán Merino d32f973c8d [i18n] Update locales 2015-11-02 15:32:55 +01:00
David Barragán Merino d051aa8593 [i18n] Update locales 2015-11-02 15:30:12 +01:00
Alejandro Alonso 768dfeb173 [backport] Fixing closed_points stats 2015-11-02 12:40:32 +01:00
Alejandro Alonso 7ce9ef6ac8 Fixing closed_points stats 2015-11-02 12:40:09 +01:00
Alejandro Alonso 3cb15f0e3e Fixing get_users_to_notify 2015-11-02 11:58:46 +01:00
Alejandro Alonso e2526c5e25 Fixing get_users_to_notify 2015-11-02 11:57:32 +01:00
Alejandro Alonso 624f27e095 Merge branch 'master' into stable 2015-11-02 09:36:13 +01:00
David Barragán Merino 28c5104d23 [i18n] Update locales 2015-11-02 09:26:28 +01:00
Alejandro 06128465f1 Merge pull request #501 from taigaio/refactor/notification-level-names
Fix notification level names
2015-11-02 09:23:33 +01:00
David Barragán Merino d573b8ab18 Fix notification level names 2015-11-02 09:13:15 +01:00
David Barragán Merino 037b098e57 [i18n] Update locales 2015-11-02 09:11:26 +01:00
David Barragán Merino 5c8c20b289 [i18n] Update locales 2015-10-30 18:20:52 +01:00
Alejandro Alonso b2ce7667c8 Fixing calculated tags for watched/voted/liked content 2015-10-30 14:48:05 +01:00
David Barragán Merino efb86b775d Fix issue #3373 Incorrect link in auto-generated issue->US promoting comment 2015-10-29 19:07:18 +01:00
David Barragán Merino b5af26cf35 Add some comments 2015-10-29 15:01:55 +01:00
David Barragán Merino e02f5481ad Merge pull request #500 from Ichag/patch-1
Fix typo
2015-10-29 11:38:11 +01:00
Max Hellwig 431500e730 Fix typo 2015-10-29 11:34:52 +01:00
David Barragán Merino 20f400d2ab Update requirements.txt 2015-10-29 10:18:33 +01:00
David Barragán Merino f8060aeef7 Update README.md 2015-10-29 09:13:00 +01:00
Alejandro Alonso 6b7d8e5280 Fixing sample_data to avoid empty tags on certain issues 2015-10-29 08:51:28 +01:00
Alejandro Alonso 3b082a1c9b Fixing watchers validators 2015-10-28 14:37:25 +01:00
Alejandro Alonso cfc72340f8 Fixing closed points calculation 2015-10-28 14:37:25 +01:00
David Barragán Merino 563088d2bd Update CHANGELOG 2015-10-28 10:00:12 +01:00
David Barragán Merino b3daa319f5 [i18n] Update locales 2015-10-27 09:55:21 +01:00
David Barragán Merino 02bd761944 Make script manage_translations.py compatible with django 1.8 2015-10-27 09:55:21 +01:00
Alejandro Alonso c23a21a9d6 Fixing bug in watched API call related to ignored notification levels 2015-10-27 08:07:39 +01:00
David Barragán Merino d9a2ef8264 Merge pull request #496 from taigaio/issue/3372/velocity-not-calculated-properly
Issue 3372: Velocity not calculated properly
2015-10-26 18:32:35 +01:00
Alejandro Alonso e98b4b9e19 Issue 3372: Velocity not calculated properly 2015-10-26 18:32:17 +01:00
David Barragán Merino 53723fe6a1 Merge pull request #497 from taigaio/burke-software-api-resource-ref
Added ref GET param to resolver API.
2015-10-26 18:27:27 +01:00
David Burke b0c57d8171 Added ref GET param to resolver API.
Useful if we know the the ref ID but not the type of object it is.
Reduces number of API calls in cases when we want to reference an object
by it's ref ID.
Modified integration test to confirm ref works just like using a us, ect
params and has same permissions.
2015-10-26 18:01:54 +01:00
David Barragán Merino b988ae4bb3 Sample data: Now project 2 and 4 are allways private 2015-10-26 12:20:34 +01:00
David Barragán Merino c720f2252f Update requirements 2015-10-24 18:22:14 +02:00
David Barragán Merino 0fc99d3d6f Merge pull request #492 from taigaio/refactoring-likes
Refactoring likes and votes
2015-10-23 10:51:59 +02:00
Alejandro Alonso 3fc725c080 Refactoring likes and votes 2015-10-23 10:51:23 +02:00
David Barragán Merino 9486387cc2 Update CHANGELOG 2015-10-20 16:08:16 +02:00
Alejandro Alonso e9879ee3a9 [Backport] Issue 2731: Using utf-8 chars in wiki titles 2015-10-19 17:32:29 +02:00
David Barragán Merino 114dd78e22 Merge pull request #488 from astagi/hotfix/resttemplates
Add template config for Django templates - Fixes #487
2015-10-15 15:30:16 +02:00
Andrea Stagi 09bbeb25fa Add template config for Django templates 2015-10-15 14:52:51 +02:00
David Barragán Merino 9cae72dc82 Merge pull request #486 from taigaio/issue-2731-using-utf8-chars-in-wiki-titles
Issue 2731: Using utf-8 chars in wiki titles
2015-10-15 11:21:48 +02:00
Alejandro Alonso d6941d6612 Issue 2731: Using utf-8 chars in wiki titles 2015-10-15 10:12:50 +02:00
David Barragán Merino 99b3477864 Generate custom attributes with random types in sample data 2015-10-15 10:12:25 +02:00
Alejandro e2000db8ee Merge pull request #485 from taigaio/allowing-date-field-type
Fix custom attributes
2015-10-15 09:54:03 +02:00
David Barragán Merino 42da17212c Fix custom attributes 2015-10-15 09:26:27 +02:00
Alejandro dd07d228a4 Merge pull request #483 from taigaio/issue/3321/emoji_extension_uses_wrong_path
Fix issue #3321: Emoji extension uses wrong path
2015-10-15 09:24:50 +02:00
David Barragán Merino 67636f1b32 Fix issue #3321: Emoji extension uses wrong path 2015-10-15 09:12:42 +02:00
Alejandro Alonso 7ec8253749 Fixing is_watcher attribute on TIU patch requests 2015-10-14 14:08:40 +02:00
Alejandro cce9b3db6e Merge pull request #479 from taigaio/django18_pytho35
Make taiga compatible with python 3.5, migrate to django 1.8 and update the rest of requirements
2015-10-13 14:30:38 +02:00
David Barragán Merino 9b56a414f0 Fix dates in license messages. Change 2014 to 2014-2015 2015-10-13 11:27:15 +02:00
David Barragán Merino a7a6bd3a1c Migrate to django 1.8 and make taiga compatible with python 3.5 2015-10-13 11:27:14 +02:00
David Barragán Merino 9226913caa Update README.md 2015-10-13 11:04:40 +02:00
David Barragán Merino 368df3709d [i18n] Update locales 2015-10-12 10:32:13 +02:00
David Barragán Merino 5c8b3ceabc [i18n] Update locales 2015-10-10 14:11:32 +02:00
David Barragán Merino 65bdad4e39 Merge pull request #475 from taigaio/Refactoring-likes-votes-watchers-and-favourites-names
Refactoring likes, votes, watchers and favourites names
2015-10-02 14:49:51 +02:00
Alejandro Alonso da8024141b Refactoring likes, votes, watchers and favourites names 2015-10-02 14:16:35 +02:00
David Barragán Merino 37c9a2fe6e FIX: Create tags in sample projects 2015-10-02 14:16:19 +02:00
David Barragán Merino d0fb4c43e5 Create tags in sample projects 2015-10-02 13:44:33 +02:00
David Barragán Merino 3742e0c3cc [Backport] Fix errors in bitbuket hook calls (improvements) 2015-10-01 14:02:59 +02:00
David Barragán Merino feec147ca7 Merge pull request #476 from taigaio/issue/3299/errors_in_bitbuket_hook_calls_v2
Fix errors in bitbuket hook calls (improvements)
2015-10-01 14:01:17 +02:00
David Barragán Merino 2e5d862282 Fix errors in bitbuket hook calls (improvements) 2015-10-01 13:35:51 +02:00
David Barragán Merino 06f645e309 [Backport] Fix errors in bitbuket hook calls 2015-10-01 12:35:41 +02:00
Alejandro 81084bba01 Merge pull request #474 from taigaio/issue/3299/errors_in_bitbuket_hook_calls
Fix errors in bitbuket hook calls
2015-10-01 12:13:48 +02:00
David Barragán Merino ffd33da80d Fix errors in bitbuket hook calls 2015-09-30 14:19:54 +02:00
Alejandro Alonso 630ea08821 Small refactor about ignored fields on HistoryEntries 2015-09-30 13:01:53 +02:00
David Barragán Merino 73c148f0fb Improve voters mixins 2015-09-30 10:58:36 +02:00
Alejandro Alonso 25489ad901 Removing watchers change details from issues, tasks and userstories activity, fixing small issue 2015-09-29 12:33:35 +02:00
Alejandro Alonso 1ed9d35d63 Removing watchers change details from issues, tasks and userstories activity 2015-09-29 12:06:28 +02:00
David Barragán Merino f4b11b26fb Minor improvements in the command 'generate_sha1' 2015-09-28 10:59:32 +02:00
David Barragán Merino 24cea7cc83 [i18n] Update locales 2015-09-26 19:41:28 +02:00
David Barragán Merino 503f320942 Merge pull request #470 from taigaio/astagi-feature/attachments-sha1
Astagi feature/attachments sha1
2015-09-25 19:43:22 +02:00
David Barragán Merino 5e8c6c5fc1 Update CHANGELOG 2015-09-25 18:53:44 +02:00
Andrea Stagi 9f47e5f396 Add generate_sha1 command 2015-09-25 18:53:44 +02:00
Andrea Stagi 60fdd540ab Add sha1 field 2015-09-25 18:53:44 +02:00
Alejandro Alonso 56cd165262 [Backport] Improving memory usage on project export 2015-09-24 20:38:56 +02:00
David Barragán Merino 774ec74077 Merge pull request #467 from taigaio/improving-memory-usage-on-project-export
Improving memory usage on project export
2015-09-24 20:37:04 +02:00
Alejandro Alonso cde9b77c0d Improving memory usage on project export 2015-09-24 20:36:04 +02:00
David Barragán Merino 76bb88b521 Merge pull request #469 from taigaio/removing-thumbnails-on-attachment-delete
Removing thumbnails on attachment deletion
2015-09-24 13:57:18 +02:00
Alejandro Alonso 7d9f3914c0 Removing thumbnails on attachment deletion 2015-09-24 13:56:53 +02:00
David Barragán Merino ca6239eda2 Merge pull request #464 from taigaio/making-total_points-and-total_sprints-nullable
Making total_points and total_sprints nullable values
2015-09-24 13:55:47 +02:00
Alejandro Alonso b750236a56 Making total_points and total_sprints nullable values 2015-09-24 13:54:07 +02:00
Alejandro Alonso d5fbe6bafe Fixing clearing watchers issue 2015-09-23 09:59:06 +02:00
David Barragán Merino b5b14c8e46 Fix order in CHANGELOG 2015-09-22 11:06:06 +02:00
David Barragán Merino 1fd480ff77 [i18n] Add italiano (it) 2015-09-22 11:03:37 +02:00
David Barragán Merino e7078fcb7d Fix a typo 2015-09-21 17:32:42 +02:00
David Barragán Merino 705cee2724 [i18n] Update locales 2015-09-18 10:54:09 +02:00
Alejandro Alonso 6e55ccdafb Using last searching features in favourites calculation 2015-09-17 12:05:11 +02:00
Alejandro Alonso bf57ace9a2 Fix some errors related to watched and likes lists 2015-09-16 15:05:20 +02:00
Alejandro Alonso 0d21f04a87 Adding votes_count sorting to issues and userstories API 2015-09-16 15:04:45 +02:00
David Barragán Merino 411441c84e Merge pull request #463 from taigaio/Issue-3147-Remove-user.photo-file-on-anonimize
Issue 3147: Remove user.photo file on anonimize
2015-09-16 12:28:37 +02:00
Alejandro Alonso 69f5b609fb Issue 3147: Remove user.photo file on anonimize 2015-09-16 12:27:01 +02:00
David Barragán Merino 52ce55f3e9 Merge pull request #458 from taigaio/refactoring-searching-system
Refactoring search system
2015-09-16 12:11:41 +02:00
Alejandro Alonso 275b2950ef Refactoring search system 2015-09-16 11:45:34 +02:00
David Barragán Merino faf7621a0b Merge pull request #461 from taigaio/issue-2991-when-a-new-comment-is-added-the-update-of-watchers-list-applies-in-the-next-future-change
Issue 2991 - When a new comment is added the update of watchers list …
2015-09-15 17:11:50 +02:00
Alejandro Alonso fd2037f456 Issue 2991 - When a new comment is added the update of watchers list applies in the next future change 2015-09-15 17:06:00 +02:00
David Barragán Merino 445d20092e Merge pull request #452 from taigaio/fixing-mentions-for-users-with-capitalized-usernames
Fixing mentions for users with capitalized usernames
2015-09-15 16:33:16 +02:00
Alejandro Alonso f0926bc0e6 Fixing mentions for users with capitalized usernames 2015-09-15 13:11:16 +02:00
David Barragán Merino 6c20341731 Merge pull request #460 from taigaio/astagi-feature/addemailfield
Add email field to UserSerializer
2015-09-15 13:06:50 +02:00
Andrea Stagi c60e177c32 Show email field for the same user or superuser 2015-09-15 12:34:43 +02:00
Alejandro Alonso 690714eadc Fixing activiy for removed users 2015-09-10 09:49:36 +02:00
Alejandro Alonso 86436ef1f2 Fixing import 2015-09-10 09:24:18 +02:00
Alejandro Alonso 77c470f062 Fixing watchers deletion when updating userstories, tasks or issues 2015-09-09 12:24:16 +02:00
David Barragán Merino 807a1719f4 Merge pull request #449 from taigaio/apps
External applications support
2015-09-09 09:42:56 +02:00
Alejandro Alonso bd09e23b61 External applications support 2015-09-09 09:39:54 +02:00
David Barragán Merino a3d996bf6b Merge pull request #451 from taigaio/refactoring-watchers-for-projects
Refactoring watchers for projects
2015-09-08 14:04:21 +02:00
Alejandro Alonso 8c990e5088 Refactoring watchers for projects 2015-09-08 13:37:26 +02:00
David Barragán Merino fd46f00ccd Update djmail to the nerw release 0.11 2015-09-08 09:31:32 +02:00
David Barragán Merino 0cb8cfc52c Set verbosity to 0 when update_all_contenttypes() 2015-09-08 09:31:32 +02:00
David Barragán Merino 4f761fe33f [i18n] Update locale catalog 2015-09-07 17:11:42 +02:00
David Barragán Merino 8141ae694b [i18n] Update locales 2015-09-07 11:45:58 +02:00
David Barragán Merino cd7e8fca2b Remove some prints 2015-09-04 11:04:08 +02:00
David Barragán Merino 285c759eb6 Fix tests errors 2015-09-04 11:04:08 +02:00
Alejandro Alonso 014941aec6 Adding notify_level to queryset for projects API 2015-09-03 11:02:58 +02:00
David Barragán Merino 58807fc964 Change notify_policy to return the notify level ('int') instead the unnecessary NotifyPolicy object 2015-09-03 09:43:13 +02:00
Alejandro 4758ed108b Merge pull request #433 from brettp/notification_threads_master
Added notification threading.
2015-09-03 08:05:08 +02:00
Brett Profitt fb710e2981 Added notification threading.
Fixes #409.
2015-09-02 19:33:37 -04:00
David Barragán Merino b43775f644 Merge pull request #447 from taigaio/refactoring-notify-policies
Refactoring notify policies
2015-09-02 17:10:28 +02:00
Alejandro Alonso a9710fee7c Refactoring notify policies 2015-09-02 17:04:43 +02:00
Alejandro e4369fa09e Merge pull request #444 from taigaio/issue/2851/closed_milestones_errors
Remove 'taiga-info-has-closed-milestones' from userstories resource and added 'taiga-info-total-opened-milestones' and 'taiga-info-total-closed-milestones' to milestones resource
2015-09-02 11:31:31 +02:00
Alejandro 72e5d89fe6 Merge pull request #445 from taigaio/change_star_project_to_like_project
Change 'star/unstar project' to 'like/unlike project'
2015-09-02 09:22:24 +02:00
David Barragán Merino 70901fd28b Remove 'taiga-info-has-closed-milestones' from userstories resource and added 'taiga-info-total-opened-milestones' and 'taiga-info-total-closed-milestones' to milestones resource 2015-09-01 19:11:54 +02:00
David Barragán Merino b5fed8e65b Change 'star/unstar project' to 'like/unlike project' 2015-09-01 19:00:55 +02:00
David Barragán Merino 260e5339c2 Fix tests 2015-09-01 18:59:56 +02:00
David Barragán Merino ca7020e9b3 Add 'taiga-info has-closed-milestones' in the headers of the call to api/v1/userstories/bulk_update_backlog_order 2015-09-01 12:04:56 +02:00
David Barragán Merino 1b5775e15e Add 'taiga-info has-closed-milestones' to Access-Control-Expose-Headers 2015-09-01 11:02:47 +02:00
David Barragán Merino 0e792d75b1 [i18n] Update locales 2015-08-28 10:26:07 +02:00
David Barragán Merino e1ac780911 [i18n] Update locales 2015-08-27 08:52:21 +02:00
David Barragán Merino ec29efa606 Merge pull request #424 from taigaio/us/2117/fa_proj/2122/upvote_content
Star/Unstar project, Upvote/Downvote issues, tasks and userstories and watch public issues, tasks and user stories
2015-08-26 15:48:34 +02:00
Alejandro Alonso 3111cf79eb Improving admin 2015-08-26 15:19:02 +02:00
Alejandro Alonso 3492b46cc9 User favourites API 2015-08-26 15:19:02 +02:00
Alejandro Alonso bccdc2fae1 Adding votes and watched projects to sample_data 2015-08-26 15:19:01 +02:00
Alejandro Alonso f3641f5cfb Refactoring and improving watchers 2015-08-26 15:10:13 +02:00
David Barragán Merino 44eee5212a Improve votes module 2015-08-26 13:35:17 +02:00
David Barragán Merino cf63031844 [i18n] Add portuguese (Brazil) (pt_BR) translation. 2015-08-25 15:03:01 +02:00
David Barragán Merino 995645af8c Merge pull request #421 from taigaio/issue-3117-after-add-task-in-bulk-to-a-closed-us-it-is-not-reopened
Issue #3117 - [Dev] After add task in bulk to a closed US, it is not …
2015-08-25 14:46:29 +02:00
Alejandro Alonso 139d22ff03 Issue #3117 - [Dev] After add task in bulk to a closed US, it is not reopened 2015-08-25 12:49:27 +02:00
David Barragán Merino 84de51d9a7 [Backport] Add partial_update_perms to permission classes to allow put requests 2015-08-25 12:22:17 +02:00
Alejandro bf00c58299 Merge pull request #442 from taigaio/hotfix/put_request_errors_partial_update_perms
Add partial_update_perms at permission classes to allow put requests
2015-08-25 12:17:13 +02:00
David Barragán Merino 132caab8d9 Add partial_update_perms to permission classes to allow put requests 2015-08-25 12:05:17 +02:00
Alejandro 0f91545c16 Merge pull request #422 from taigaio/issue/2851/closed_sprints_problems
Add has-closed-milestones to the response headers when upsdate us orders in bulk for sprints
2015-08-25 12:04:07 +02:00
David Barragán Merino d34f47ccff Add has-closed-milestones to the response headers when upsdate us orders in bulk for sprints 2015-08-25 11:44:17 +02:00
David Barragán Merino 5dbdedd44d [i18n] Update locales 2015-08-24 10:37:00 +02:00
Alejandro Alonso 1350167cec [Backport] Issue - #3185 Import user story with role points results in an IntegrityError 2015-08-14 10:20:46 +02:00
Alejandro Alonso 811a6c7906 Issue - #3185 Import user story with role points results in an IntegrityError 2015-08-14 10:08:21 +02:00
David Barragán Merino 95c57eb7e5 [i18n] Update locales 2015-08-13 10:04:33 +02:00
Alejandro Alonso 3d6d162997 [Backport] Removing descriptions from list API 2015-08-10 14:05:14 +02:00
Jesús Espino 5eb8a27f6f [Backport] Fix membership timeline entries in the user profile 2015-08-10 08:08:21 +02:00
Alejandro 9013bf5bcc Merge pull request #427 from taigaio/profile-timeline-fix
Fix membership timeline entries in the user profile
2015-08-10 08:06:32 +02:00
David Barragán Merino ae34c6490f [i18n] update locales 2015-08-08 21:34:48 +02:00
Jesús Espino a744146af9 Fix membership timeline entries in the user profile 2015-08-08 15:21:51 +02:00
David Barragán Merino 2681c7dcd5 Merge pull request #420 from taigaio/remove-descriptions-from-listin-API
Removing descriptions from list API
2015-08-07 00:29:31 +02:00
Alejandro Alonso 32c6452bfa Removing descriptions from list API 2015-08-06 18:50:38 +02:00
Jesús Espino 6756db650c [Backport] Add logging to export_import exceptions 2015-08-06 17:36:26 +02:00
David Barragán Merino cfde18c54c Merge pull request #426 from taigaio/logging-export-import-exceptions
Add logging to export_import exceptions
2015-08-06 17:35:29 +02:00
Jesús Espino 340f2442b3 Add logging to export_import exceptions 2015-08-06 17:20:29 +02:00
Alejandro 65d1db1c33 Merge pull request #419 from taigaio/issue/3125/searchs-api
Issue/3125/searchs api
2015-08-04 14:01:51 +02:00
David Barragán Merino 84f517559a Revert "Add full-text index to the search app"
This reverts commit b4a30f64af.
2015-08-03 16:57:22 +02:00
David Barragán Merino a251761b18 Revert "Add support for partial words on global searches"
This reverts commit 9cbecd9b7e.
2015-08-03 14:44:08 +02:00
David Barragán Merino 0adc0ebf9e Return an empty list even in bad searchs 2015-08-03 14:38:43 +02:00
David Barragán Merino ade6297082 [i18n] Add ru 2015-08-03 11:13:48 +02:00
David Barragán Merino d9028cfbed [i18n] Update locles 2015-08-02 10:38:35 +02:00
David Barragán Merino 10bfa3cbe2 Merge pull request #412 from taigaio/adding-deleted-datetime-to-webhooks-when-deleting-elements
Adding deleted datetime to webhook sent info when deleting elements
2015-07-31 09:39:30 +02:00
Alejandro Alonso f6f3a5a0af Adding deleted datetime to webhook sent info when deleting elements 2015-07-31 09:39:02 +02:00
David Barragán Merino 66a3398c33 [118n] Update locales 2015-07-31 09:21:04 +02:00
Alejandro Alonso 7eb5acd969 Disabling most signals on bulk creation 2015-07-31 07:52:05 +02:00
Jesús Espino 5192136ab5 Merge pull request #413 from taigaio/disabling-most-signals-on-bulk-creation
Disabling most signals on bulk creation
2015-07-30 17:16:28 +02:00
Alejandro Alonso f5f575267d Disabling most signals on bulk creation 2015-07-30 14:31:26 +02:00
Alejandro Alonso ecf200f418 [Backport] Fixing signals disconnection 2015-07-30 14:18:29 +02:00
Jesús Espino 33e44d3d8e Merge pull request #411 from taigaio/fixing-signals-disconnection
Fixing signals disconnection
2015-07-30 14:08:32 +02:00
Alejandro Alonso d750a1dc90 Fixing signals disconnection 2015-07-30 09:34:04 +02:00
Alejandro Alonso 3869f986e7 [Backport] Adding neighbors info only in GET requests to API 2015-07-29 08:19:13 +02:00
Jesús Espino d62625136b Merge pull request #407 from taigaio/calculating-neighbors-only-when-needed
Adding neighbors info only in GET requests to API
2015-07-28 15:15:38 +02:00
Alejandro Alonso 64b636678b Adding neighbors info only in GET requests to API 2015-07-28 15:05:04 +02:00
David Barragán Merino 9bc0e976ca Refactor users_stats method: use django queryset system 2015-07-28 12:03:19 +02:00
Alejandro ea6b9ae324 Merge pull request #350 from taigaio/refactoring-filter-data-API
Refactoring filter data API
2015-07-28 08:58:35 +02:00
David Barragán Merino 21153ea1aa Improve userstories/filters_data and issues/filter_data 2015-07-28 08:21:08 +02:00
David Barragán Merino 2be24e96bf Minor fix 2015-07-27 17:40:13 +02:00
David Barragán Merino b75b88d750 Minor fix 2015-07-27 17:39:53 +02:00
David Barragán Merino 3531b440bd Improved system stats 2015-07-27 17:34:38 +02:00
David Barragán Merino c4bdbd9c8e Improved system stats 2015-07-27 17:34:04 +02:00
David Barragán Merino cd8e3160aa [i18n] Add polish (pl) translation 2015-07-26 23:31:12 +02:00
Alejandro Alonso 1ea444fd38 Enabling kanban module for al the sample_data 2015-07-24 13:56:30 +02:00
Alejandro Alonso eb200b7607 [Backport] Adding command for rebuilding timelines iterating per project 2015-07-23 13:21:03 +02:00
David Barragán Merino 7c53dce071 [Backport] Fix timelines generation 2015-07-23 13:09:07 +02:00
David Barragán Merino 7880f3e2ae [Backport] Divide some long lines 2015-07-23 13:08:52 +02:00
David Barragán Merino b7f83b48c9 [Backport] Add is_profile_visible to timeline_entty.user object 2015-07-23 13:08:30 +02:00
Alejandro d5c800d3e5 Merge pull request #392 from taigaio/issue/3019/duplicate-entries-in-profile-timelines
Issue/3019/duplicate entries in profile timelines and more
2015-07-23 12:49:57 +02:00
David Barragán Merino 7ad293b311 Update CHANGELOG 2015-07-23 12:07:35 +02:00
David Barragán Merino 7fdbe2907a Disabled some unnecessary timeline commands 2015-07-23 12:07:35 +02:00
Alejandro Alonso a63182e342 Adding command for rebuilding timelines iterating per project 2015-07-23 12:07:35 +02:00
David Barragán Merino 51fe131c13 Fix timelines generation 2015-07-23 12:07:35 +02:00
David Barragán Merino cb2ba72e67 [Backport] Travis: Migrating from legacy to container-based infrastructure 2015-07-23 11:40:20 +02:00
Alejandro Alonso fc2f6bb4e4 [Backport] Json export generation in a more efficient way 2015-07-23 10:53:08 +02:00
David Barragán Merino 72486a3a06 Merge pull request #405 from taigaio/more-efficient-json-export-generation
Json export generation in a more efficient way
2015-07-23 10:51:39 +02:00
Alejandro Alonso a909171eb7 Json export generation in a more efficient way 2015-07-23 10:20:16 +02:00
David Barragán Merino 938c9bca75 Add a full name to the administrator user 2015-07-22 16:43:29 +02:00
Alejandro ae0beffaa7 Merge pull request #404 from taigaio/travis-updated
Travis: Migrating from legacy to container-based infrastructure
2015-07-22 15:02:55 +02:00
Alejandro Alonso 9f1f002a54 Fixing slug project generation for sample_data 2015-07-22 12:32:57 +02:00
Alejandro Alonso 2a4ad10de9 Adding watchers to sample_data 2015-07-22 12:13:09 +02:00
David Barragán Merino 86a8d359b6 Travis: Migrating from legacy to container-based infrastructure 2015-07-21 19:37:10 +02:00
David Barragán Merino c13dcb7757 New migration to add videoconferences_extra_data field in Project and ProjectTenmplate 2015-07-21 17:17:13 +02:00
David Barragán Merino 181a3858d1 [i18n] Update locales 2015-07-10 13:23:33 +02:00
David Barragán Merino b079f7709c Minor fixex in local.py.example 2015-07-10 13:06:32 +02:00
David Barragán Merino 77f9d34be6 Force settings.DEBUG = False in timeline manage commands 2015-07-10 09:58:17 +02:00
David Barragán Merino 4df5224259 Divide some long lines 2015-07-09 13:56:28 +02:00
David Barragán Merino 9d54dc63b5 [i18n] Update locales 2015-07-06 16:44:12 +02:00
David Barragán Merino 99c0e21757 Fix more texts 2015-07-06 16:07:38 +02:00
David Barragán Merino 31a8e0749f Fix some texts 2015-07-06 13:59:50 +02:00
Jesús Espino df9317cb4a Fix gilab migration 2015-07-06 12:08:49 +02:00
David Barragán Merino 81fbe96ea6 [i18n] Update locales 2015-07-05 11:20:28 +02:00
David Barragán Merino 37c41624f9 Merge pull request #389 from taigaio/issue/2959/fix-user-profile-links-in-timeline
Add is_profile_visible to timeline_entty.user object
2015-07-03 14:58:28 +02:00
David Barragán Merino 27c3ee5c79 Add is_profile_visible to timeline_entty.user object 2015-07-03 14:58:11 +02:00
David Barragán Merino 6d9c043248 Merge pull request #385 from taigaio/gitlab-comments-sync
Add gitlab integration with commets webhook
2015-07-03 14:57:24 +02:00
David Barragán Merino 33a0065713 Update gitlab user logo 2015-07-03 14:55:34 +02:00
Jesús Espino 3bae896199 Add gitlab integration with commets webhook 2015-07-03 12:52:43 +02:00
David Barragán Merino 8c60b9f22b Merge pull request #386 from taigaio/issue/2995/add-custom-video-conference
Issue#2995: Add custom video conference system
2015-07-02 19:52:43 +02:00
Jesús Espino ba828b4aa2 Issue#2995: Add custom video conference system 2015-07-02 19:07:27 +02:00
David Barragán Merino 212e214493 [Backport] Add system-stats endpoint 2015-07-02 12:23:28 +02:00
David Barragán Merino dd950dcbf8 Merge pull request #388 from taigaio/us/2126/task/2999/system-stats-resource
Us/2126/task/2999/system stats resource
2015-07-02 12:21:16 +02:00
David Barragán Merino 69d1ed91a3 Update CHANGELOG 2015-07-02 11:33:42 +02:00
David Barragán Merino 03ff40ddd4 Add system-stats endpoint 2015-07-02 11:33:26 +02:00
David Barragán Merino bc2d8ece7f Update regenerate.sh - Remove unnecessary commands 2015-07-02 00:41:06 +02:00
David Barragán Merino 16f39c8b73 Add @al42and to AUTHORS 💃 2015-06-30 20:39:50 +02:00
Jesús Espino 12b93b78a1 Remove more unnecesary lowercase on attachments 2015-06-30 20:34:56 +02:00
Jesús Espino eeaac88463 Remove unnecesary lowecase of attachments filename 2015-06-30 20:08:57 +02:00
Andrey Alekseenko 8742f0cabb Using get_valid_filename to sanitize attachment names 2015-06-30 20:06:41 +02:00
Jesús Espino 0e39653da9 Allow multiple message actions on commit 2015-06-30 19:20:58 +02:00
Jesús Espino 17ceab000c Issue#2650: Allow local network ips in gitlab and bitbucket ip filters 2015-06-30 19:13:04 +02:00
Jesús Espino 6dcbaef2fb [Backport] Issue#2981: Adapt taiga to the new bitbucket webhooks 2015-06-30 18:00:58 +02:00
David Barragán Merino 485799918e Merge pull request #382 from taigaio/issue/2981/bitbucket-webhooks-fix
Issue/2981/bitbucket webhooks fix
2015-06-30 17:54:16 +02:00
Jesús Espino ce409f266e [Backport] Fix us auto closing test 2015-06-30 16:56:59 +02:00
Jesús Espino 8b6fa19a56 Issue#2981: Adapt taiga to the new bitbucket webhooks (Changelog) 2015-06-30 16:56:00 +02:00
Jesús Espino 9769386b8e Issue#2981: Adapt taiga to the new bitbucket webhooks 2015-06-30 16:56:00 +02:00
David Barragán Merino edc96b3356 Merge pull request #384 from taigaio/fix-tests
Fix us auto closing test
2015-06-30 16:55:04 +02:00
Jesús Espino c80152599a Fix us auto closing test 2015-06-30 15:07:46 +02:00
Jesús Espino c8e05c17f2 [Backport] Allow default status, priority, severity and type in issues and tasks 2015-06-29 18:59:01 +02:00
David Barragán Merino 5f9f70ab20 [Backport] Revert "Fix migration"
This reverts commit d4446cd426.
2015-06-29 18:58:39 +02:00
David Barragán Merino 9d94de9b21 Revert "Fix migration"
This reverts commit d4446cd426.
2015-06-29 18:57:08 +02:00
David Barragán Merino 4aabfd3c26 [Backport] Fix migration 2015-06-29 18:14:08 +02:00
David Barragán Merino d4446cd426 Fix migration 2015-06-29 18:13:33 +02:00
Jesús Espino 1083962791 [Backport] Issue#2967: Don't delete tasks on milestone delete 2015-06-29 18:06:20 +02:00
Jesús Espino b23d3bdeb3 [Backport] Issue#2884: Crop images for the timeline 2015-06-29 18:05:29 +02:00
David Barragán Merino 06c44fa1e8 Merge pull request #381 from taigaio/issue/2967/dont-delete-tasks-on-milestone-delete
Issue#2967: Don't delete tasks on milestone delete
2015-06-29 18:04:14 +02:00
Jesús Espino 7ff2126b49 Issue#2967: Don't delete tasks on milestone delete 2015-06-29 18:03:47 +02:00
David Barragán Merino a3f0b5eba5 Merge pull request #380 from taigaio/issue/2884/crop-images-for-timeline
Issue#2884: Crop images for the timeline
2015-06-29 18:02:36 +02:00
Jesús Espino 83b8243d39 Issue#2884: Crop images for the timeline 2015-06-29 16:57:17 +02:00
David Barragán Merino 3834edd88e [Backport] [i18n] Update locales 2015-06-29 14:46:48 +02:00
David Barragán Merino 00901a3c93 [i18n] Update locales 2015-06-29 14:46:03 +02:00
David Barragán Merino 4267b6c7a7 Merge pull request #379 from taigaio/issue/2966/mileston-text-on-emails
Issue#2966: Change text "milestone" by "sprint" in change emails
2015-06-29 13:30:09 +02:00
Jesús Espino 6aea158762 Issue#2966: Change text "milestone" by "sprint" in change emails 2015-06-29 12:49:19 +02:00
Alejandro 4843668a03 Merge pull request #377 from taigaio/issue/2785/fix-user-mentions
Issue/2785/fix user mentions
2015-06-26 05:35:43 -07:00
David Barragán Merino 2d25286084 Add is_active to UserBasicInfoSerializer 2015-06-26 13:13:55 +02:00
David Barragán Merino 45186558a7 Added owner extra info to serializers 2015-06-26 13:13:55 +02:00
David Barragán Merino 07a48372e3 Add user info to the HistoryEntrySerializer 2015-06-26 13:13:55 +02:00
David Barragán Merino a7b9873e8d [i18n] Update locales de 2015-06-26 12:07:29 +02:00
Alejandro 25dbc39c70 Merge pull request #374 from taigaio/issue/2572/on-status-open-closed-change-recalc-closed-user-stories
Issue#2572: On status open/closed change recalc the is_closed for use…
2015-06-26 00:13:30 -07:00
Jesús Espino 3e8c1814d5 Issue#2572: On status open/closed change recalc the is_closed for user stories 2015-06-26 09:02:28 +02:00
Alejandro 23d7cf3cce Merge pull request #375 from taigaio/issue/2650/allow-local-networks-ips-in-gitlab-and-bitbucket
Issue#2650: Allow local network ips in gitlab and bitbucket ip filters
2015-06-25 23:22:46 -07:00
Jesús Espino fad37091e8 Issue#2650: Allow local network ips in gitlab and bitbucket ip filters 2015-06-26 08:06:46 +02:00
David Barragán Merino 92d84ae514 [Backport] [i18n] Update locales 2015-06-25 18:08:42 +02:00
David Barragán Merino d24be5b5df [Backport] Make minor improvements over front sitemap 2015-06-25 18:06:19 +02:00
David Barragán Merino 6d33c7821d Make minor improvements over front sitemap 2015-06-25 18:05:27 +02:00
Jesús Espino 3f91460ccb Merge pull request #372 from taigaio/concurrent-queries-for-global-search-results
Concurrent queries for global search results
2015-06-25 16:36:31 +02:00
Alejandro Alonso 8b05f206b2 Concurrent queries for global search results 2015-06-25 16:37:15 +02:00
David Barragán Merino 30e08c61ef Excluded some unnecessary fields in ProjectMemberSerializer 2015-06-25 16:13:35 +02:00
Alejandro 02ee9c8085 Merge pull request #373 from taigaio/full-index-for-searches
Add full-text index to the search app
2015-06-25 06:05:49 -07:00
Jesús Espino b4a30f64af Add full-text index to the search app 2015-06-25 14:27:16 +02:00
David Barragán Merino 3f369cf799 Update CHANGELOG 2015-06-25 11:48:02 +02:00
David Barragán Merino de5297c603 Merge pull request #370 from taigaio/issue-2818-when-I-coment-a-story-a-should-be-involved-by-it
Issue 2818 - When I comment a story, I should be "Involved" by the story
2015-06-25 11:44:14 +02:00
Alejandro Alonso 4480cb474e Issue 2818 - When I comment a story, I should be "Involved" by the story 2015-06-25 10:19:23 +02:00
Alejandro f73f30e6b9 Merge pull request #364 from taigaio/issue/2943/on-project-change-regenerate-refs-for-task-issues-uss
Issue#2943: Regenerate refs for tasks, issues and user stories on project change
2015-06-25 01:04:57 -07:00
Alejandro a1c8e0e699 Merge pull request #371 from taigaio/issue/2803/slow-search-results
Issue#2803: Reduce the amount of data on search results
2015-06-25 00:46:11 -07:00
Jesús Espino 3e1a52e350 [Backport] Fix import and deletion of projects 2015-06-25 07:48:29 +02:00
Jesús Espino aaf89ebb04 Issue#2943: Regenerate refs for tasks, issues and user stories on project change 2015-06-24 20:15:02 +02:00
Jesús Espino a3b5fd8feb Issue#2803: Reduce the amount of data on search results 2015-06-24 19:47:13 +02:00
David Barragán Merino 060fb15ad8 [Backport] [i18n] Update locales 2015-06-24 13:32:21 +02:00
David Barragán Merino 8167439828 [i18n] Update locales 2015-06-24 13:31:46 +02:00
Alejandro Alonso ed8075acc3 [Backport] Issue #2916: When leaving a project I lose all my watched stuff (even from different projects) 2015-06-24 13:07:41 +02:00
David Barragán Merino c8a79be642 Merge pull request #362 from taigaio/issue-2916-when-leaving-a-project-I-lose-all-my-watched-stuff
Issue #2916: When leaving a project I lose all my watched stuff (even from different projects)
2015-06-24 12:35:49 +02:00
Alejandro Alonso 6a0b4687d8 Issue #2916: When leaving a project I lose all my watched stuff (even from different projects) 2015-06-24 11:59:39 +02:00
Alejandro 109d3e19f4 Merge pull request #363 from taigaio/us/2911/mixin_users_with_memberships_in_project_detail_serializer
US #2911: Mixin 'users', 'members' and 'memberships' in ProjectDetailSerializer
2015-06-24 01:25:04 -07:00
David Barragán Merino d70800d3e6 US #2911: Mixin 'users', 'members' and 'memberships' in ProjectDetailSerializer 2015-06-24 10:25:15 +02:00
Alejandro b5a1f6f5bf Merge pull request #368 from taigaio/issue/2592/default-status-on-tasks-and-issues
Allow default status, priority, severity and type in issues and tasks
2015-06-24 01:14:06 -07:00
Jesús Espino c32d505b96 Allow default status, priority, severity and type in issues and tasks 2015-06-24 10:12:33 +02:00
Alejandro b22c5a671f Merge pull request #361 from taigaio/import-delete-project-fix
Fix import and deletion of projects
2015-06-24 00:54:07 -07:00
Alejandro d4135c6928 Merge pull request #365 from taigaio/issue/1924/allow-multiple-message-action-on-commits
Allow multiple message actions on commit
2015-06-24 00:26:43 -07:00
Alejandro 4a9eb9b7d3 Merge pull request #366 from taigaio/issue/2584/global-search-with-partial-words
Add support for partial words on global searches
2015-06-24 00:07:20 -07:00
Alejandro fec2bf142c Merge pull request #367 from taigaio/issue/2518/wiki-toc-links
Allow to include id attributes in the elements (to allow anchor links)
2015-06-24 00:05:39 -07:00
Alejandro 9a86065cb3 Merge pull request #369 from taigaio/refactor/tests
Refactored some tets
2015-06-23 23:54:22 -07:00
Jesús Espino 4ae37167f5 Allow multiple message actions on commit 2015-06-24 07:24:46 +02:00
David Barragán Merino 9f253394a4 Refactored some tets 2015-06-24 00:41:32 +02:00
Jesús Espino 79c079d2cb Allow to include id attributes in the elements (to allow anchor links) 2015-06-23 21:26:54 +02:00
Jesús Espino 9cbecd9b7e Add support for partial words on global searches 2015-06-23 21:26:34 +02:00
Jesús Espino 91c9056823 Fix import and deletion of projects 2015-06-23 21:25:53 +02:00
Jesús Espino 8efeb406fd Adding more deterministic timeline ordering, by time and id 2015-06-23 21:24:40 +02:00
David Barragán Merino 67bf755771 Fix migrations of custom_attributes 2015-06-23 19:56:37 +02:00
David Barragán Merino f94f52b8ac Update CHANGELOG 2015-06-23 18:57:50 +02:00
Alejandro Alonso a1b9ced71a [Backport] Fixing I18NJsonField 2015-06-23 10:20:30 +02:00
Alejandro Alonso 68181b8c5f Fixing I18NJsonField 2015-06-23 10:20:09 +02:00
Alejandro 67bfc01392 Merge pull request #355 from artlepool/master
Supporting a "field type" property for custom fields (taiga-front #451)
2015-06-22 23:35:32 -07:00
Alejandro 99e3600fcc Merge pull request #357 from taigaio/api-improvements
Make minor improvements over Membership and Project serializers
2015-06-22 23:32:22 -07:00
David Barragán Merino d6b3a8b940 [Backport] [i18n] Update locales 2015-06-20 22:30:12 +02:00
David Barragán Merino 1bd2a6c0de [i18n] Update locales 2015-06-20 22:29:22 +02:00
David Barragán Merino 15af8ef3cc Update changelog 2015-06-20 22:25:05 +02:00
Alejandro Alonso ce3a799741 [Backport] Fixing created datetime for timeline entries 2015-06-19 11:18:37 +02:00
David Barragán Merino 5d7a430eea Merge pull request #359 from taigaio/fixing-created-datetime-for-timeline-entries
Fixing created datetime for timeline entries
2015-06-19 11:16:12 +02:00
Alejandro Alonso aff9a7d637 Fixing created datetime for timeline entries 2015-06-19 11:14:03 +02:00
David Barragán Merino debf641767 Make minor improvements over Membership and Project serializers 2015-06-18 17:45:07 +02:00
Chris Wilson 85b24322af Add a default value of TEXT to the new field_type attribute on the custom attribute model 2015-06-18 16:10:26 +01:00
David Barragán Merino b60922422d Merge branch 'master' into stable 2015-06-18 12:10:26 +02:00
Alejandro Alonso 432f97a5cb Making project slug readonly in the API 2015-06-18 10:58:40 +02:00
David Barragán Merino 98dc229b0f Update CHANGELOG 2015-06-18 10:06:27 +02:00
Alejandro Alonso 22d4483755 Issue #2874 - Login invitation fail when the user mail has more thant 30 characters 2015-06-18 09:15:47 +02:00
Chris Wilson edfb98de72 Merge remote-tracking branch 'upstream/master' 2015-06-17 20:33:00 +01:00
David Barragán Merino 94753c0f41 [i18n] update locales 2015-06-17 20:41:40 +02:00
Alejandro Alonso ad6fe4c358 Fixing rebuild_timeline command 2015-06-17 18:05:50 +02:00
Alejandro Alonso 7d30ee5e00 Fixing history import and export 2015-06-17 17:11:15 +02:00
Alejandro Alonso 5f58042e44 Improving rebuild_timeline command allowing rebuilding it only for a project 2015-06-17 10:15:44 +02:00
David Barragán Merino 2499290a59 Update changelog 2015-06-17 09:51:51 +02:00
David Barragán Merino 6990e8e7a5 [i18n] Fix a typo 2015-06-17 09:44:58 +02:00
David Barragán Merino 5d3f3fb9b0 Add X-Pagination-Next y X-Pagination-Prev to Access-Control-Expose-Headers response header 2015-06-16 14:22:55 +02:00
Alejandro Alonso a86b741edb Adding is_active to membership serializer 2015-06-16 12:49:02 +02:00
Alejandro Alonso be9530c416 Fixing issues and tasks API i18n fields 2015-06-16 11:58:39 +02:00
David Barragán Merino 69050b21a0 Merge pull request #352 from taigaio/change-email-from-link-for-anonymous-users-too
Now anonymous users can confirm the change of email even if they are …
2015-06-15 13:46:39 +02:00
Alejandro Alonso e54802f0b1 Now anonymous users can confirm the change of email even if they are not authenticated, some users update the email from a desktop browser but check the email from mobile 2015-06-15 12:45:42 +02:00
David Barragán Merino ccd1a9cdd9 Ignore emacs tmp files 2015-06-15 12:45:14 +02:00
David Barragán Merino 134f873bcb [18n] Update locales 2015-06-15 12:36:37 +02:00
Alejandro Alonso 7cb0b2b237 Fixing regenerate command (adding --purge option) 2015-06-15 09:33:44 +02:00
Alejandro Alonso 9c580e0417 Fixing regenerate command (adding --purge option) 2015-06-15 09:30:39 +02:00
Alejandro Alonso 09e5b20673 Fixing regenerate command 2015-06-15 09:23:17 +02:00
Alejandro b9c11380ed Merge pull request #353 from taigaio/issue/2839-timeline_delete_comment
Add comment_deleted attr to timeline entries
2015-06-12 02:35:18 -07:00
David Barragán Merino 2d5a3875ba Add comment_deleted attr to timeline entries 2015-06-12 10:03:42 +02:00
Alejandro Alonso faed2d33d4 [Backport] Adding is_closed filter to user stories 2015-06-11 13:40:13 +02:00
Alejandro Alonso de88b0e436 [Backport] Adding user creation to user profile timeline 2015-06-11 12:14:05 +02:00
David Barragán Merino 11b6929a46 Merge pull request #346 from taigaio/adding-user-creation-to-timeline
Adding user creation to user profile timeline
2015-06-11 12:13:06 +02:00
Alejandro Alonso 7663e658c1 Adding user creation to user profile timeline 2015-06-11 11:41:33 +02:00
Alejandro Alonso 1f7ca6cb97 Fixing clear_unnecessary_new_membership_entries manage command 2015-06-11 11:32:25 +02:00
Alejandro Alonso 412c25faee [backport] Adding new membership to timelines only if necessary 2015-06-11 11:27:28 +02:00
Alejandro Alonso 538805bd73 [Backport] Fixing new membership in timelines 2015-06-11 11:27:14 +02:00
Alejandro Alonso cfdb0c1280 Adding new membership to timelines only if necessary 2015-06-11 11:26:35 +02:00
David Barragán Merino b547c16512 [i18n] Update translations 2015-06-11 10:14:32 +02:00
Alejandro Alonso 3232411d83 Fixing new membership in timelines 2015-06-11 10:12:39 +02:00
David Barragán Merino 1176abde08 Merge pull request #348 from taigaio/issue/2644/Windows-lotus-mails
Fix Background color and font color in Windows Lotus
2015-06-10 12:30:59 +02:00
Xavier Julián 56aca11a66 Fix Background color and font color in Windows Lotus 2015-06-10 12:30:34 +02:00
David Barragán Merino ec0a88dd08 [i18n] Added new locales: de, nl 2015-06-10 09:50:49 +02:00
Chris Wilson 77591b8ad6 Merge remote-tracking branch 'upstream/master' 2015-06-09 14:52:48 +01:00
Alejandro Alonso acbd253420 Adding multiple status filtering to userstories 2015-06-09 15:06:51 +02:00
Alejandro Alonso a77f21776f Fixing I18NJsonField for a not covered scenario with None data 2015-06-09 10:33:57 +02:00
David Barragán Merino 29694b8e21 Update locales 2015-06-09 09:48:23 +02:00
David Barragán Merino d2cfd751d7 Update CHANGELOG 2015-06-09 09:30:03 +02:00
Chris Wilson 0f9ae58fb2 Adding field_type to custom attributes model, with associated migration 2015-06-08 16:22:15 +01:00
Alejandro fe6f3d10f2 Merge pull request #340 from taigaio/sitemap
Sitemap
2015-06-08 05:54:55 -07:00
David Barragán Merino 9232c2e771 Create /front/sitemap.xml 2015-06-06 09:30:22 +02:00
David Barragán Merino d8e4ce02f7 Merge pull request #347 from taigaio/issue/2642/email-templates
Email templates fix
2015-06-06 09:29:39 +02:00
Xavier Julián d5e8b2ffd5 Fixed fields diff broken layout 2015-06-05 14:34:53 +02:00
Xavier Julián 30ef152202 Fix gray color in emails 2015-06-05 13:57:50 +02:00
Alejandro Alonso ac80c4a6e2 Adding is_closed filter to user stories 2015-06-03 14:57:49 +02:00
David Barragán Merino 369f247d9d Merge pull request #344 from taigaio/Issue-2781-tagging-teammates-with-period-in-their-username
Tagging teammates with period in their username
2015-06-03 13:52:09 +02:00
Alejandro Alonso 0b8f958a73 Tagging teammates with period in their username 2015-06-03 13:51:41 +02:00
Alejandro Alonso 5d958b6452 [Backport] Issue #2761 Filtering issues by more than one assigned_to returns error 400 2015-06-03 11:51:45 +02:00
Alejandro Alonso 7cfa01c58f Issue #2761 Filtering issues by more than one assigned_to returns error 400 2015-06-03 11:51:07 +02:00
Alejandro Alonso 6128cce031 [Backport] Fixing memberships order in ProjectDetailSerializer 2015-06-03 09:01:08 +02:00
Alejandro Alonso 8b791cd4d8 Fixing memberships order in ProjectDetailSerializer 2015-06-03 09:00:50 +02:00
Alejandro Alonso ae4786825e [Backport] Fixing the ordering for the contacts endpoint in the users API 2015-06-03 08:34:53 +02:00
Alejandro Alonso dc7940c772 Fixing the ordering for the contacts endpoint in the users API 2015-06-03 08:34:12 +02:00
Alejandro Alonso 03f395a384 Fixing version validation when the parameter isn't used in the patch 2015-06-02 12:14:27 +02:00
David Barragán Merino 21f847f5ca Merge branch 'astagi-feature/themes' 2015-06-02 09:48:05 +02:00
Andrea Stagi f2d9eb6326 Add theme field to User 2015-06-01 19:58:29 +02:00
Alejandro Alonso 29b75dc78a [Backport] Fixing contacts and stats endpoints for users API 2015-06-01 11:44:59 +02:00
Alejandro Alonso 4163d42163 Fixing contacts and stats endpoints for users API 2015-06-01 11:44:36 +02:00
Alejandro Alonso 56a347e608 [Backport] Adding user story info to task change timeline entries 2015-06-01 09:09:43 +02:00
David Barragán Merino b3ceb9ed25 Merge pull request #338 from taigaio/niwinz-patch-1
Update .travis.yml
2015-05-28 16:56:10 +02:00
Andrey Antukh d9db899ca9 Update .travis.yml 2015-05-28 16:55:47 +02:00
Alejandro Alonso b6958708ea Adding user story info to task change timeline entries 2015-05-28 15:30:07 +02:00
Alejandro Alonso 8f544663c7 Updating project list and detail serializers 2015-05-28 14:51:26 +02:00
Alejandro Alonso 0da02266c9 Revert "Updating project list and detail serializers"
This reverts commit 7f52d81bdd.
2015-05-28 14:47:03 +02:00
Alejandro Alonso 7f52d81bdd Updating project list and detail serializers 2015-05-28 14:44:15 +02:00
David Barragán Merino 192a497916 Add some urls to the front module 2015-05-28 10:25:44 +02:00
Alejandro Alonso 049ae807a8 [Backport] Fixing contacts API 2015-05-27 14:23:58 +02:00
Alejandro Alonso e61d6ec226 Fixing contacts API 2015-05-27 14:10:54 +02:00
Alejandro Alonso 44a319abfd [Backport] Adding by_username endpoint to users API 2015-05-27 11:41:13 +02:00
David Barragán Merino 4fe93c73cb Update CHANGELOG 2015-05-27 11:39:00 +02:00
David Barragán Merino 557cd6ed77 Merge pull request #330 from taigaio/adding-by_username-endpoint-to-users-API
Adding by_username endpoint to users API
2015-05-27 11:37:21 +02:00
Alejandro Alonso 955a3a32e2 Adding by_username endpoint to users API 2015-05-27 11:36:37 +02:00
Alejandro Alonso b16cbd788e [backport] Adding username to ProjectMembershipSerializer 2015-05-27 10:56:04 +02:00
David Barragán Merino fcaa0f7f3b Update CHANGELOG 2015-05-26 17:00:57 +02:00
Alejandro 6631f40ef4 Merge pull request #337 from artlepool/master
Allow users to enter a ref number in the search
2015-05-26 06:03:34 -07:00
Alejandro Alonso dc456da449 Adding username to ProjectMembershipSerializer 2015-05-26 15:02:59 +02:00
Chris Wilson 8ecc4b62de Added Ref column into the list of columns that are searched 2015-05-26 12:41:27 +01:00
David Barragán Merino 7a45907f0c [Backport] Update locales 2015-05-25 17:53:09 +02:00
David Barragán Merino c8e3c7e465 Update locales 2015-05-25 17:52:35 +02:00
David Barragán Merino 71a8096221 [Backport] Fix a bug that create non-ouner memberships where the importer user is a member of the importer project. 2015-05-25 15:57:06 +02:00
David Barragán Merino e3ebc35670 Merge pull request #331 from taigaio/bug/importer-perrmisisons-and-memberships
Fix a bug that create non-ouner memberships where the importer user is a member of the importer project
2015-05-25 15:54:15 +02:00
David Barragán Merino ce67686eb4 [Backport] Update locales 2015-05-25 15:52:48 +02:00
David Barragán Merino a3db15c2e1 [Backport] Revert "Temporary disable public projects on listings"
This reverts commit 5a45db23fc.
2015-05-25 15:52:12 +02:00
David Barragán Merino bc14cdee90 Update locales 2015-05-25 15:30:04 +02:00
David Barragán Merino 29b3de6101 Revert "Temporary disable public projects on listings"
This reverts commit 5a45db23fc.
2015-05-25 15:24:06 +02:00
David Barragán Merino 6fe69f4c7a Fix a bug that create non-ouner memberships where the importer user is a member of the importer project. 2015-05-25 12:58:34 +02:00
David Barragán Merino 4b646522ec Update CHANGELOG 2015-05-22 15:38:50 +02:00
David Barragán Merino 04ab431361 Update CHANGELOG 2015-05-22 15:32:50 +02:00
Alejandro Alonso 57aee955f1 [backport] Improving rebuild timeline command 2015-05-22 12:58:39 +02:00
Alejandro Alonso 0d40562a4a Improving rebuild timeline command 2015-05-22 12:58:20 +02:00
Alejandro Alonso 39311d9004 [backport] Fixing projects_with_me in users API 2015-05-22 09:27:47 +02:00
Alejandro Alonso 948f024cdf Fixing projects_with_me in users API 2015-05-22 09:27:25 +02:00
David Barragán Merino 74bf3b4160 Update gunicorn 2015-05-21 17:56:05 +02:00
David Barragán Merino 5840eb3281 [Backport] Fix error with emails and user.lang 2015-05-21 14:39:39 +02:00
David Barragán Merino cc4ca95864 Fix error with emails and user.lang 2015-05-21 14:39:03 +02:00
David Barragán Merino 316220736d Update locals.py.example 2015-05-21 14:29:45 +02:00
Alejandro Alonso 4f186f6f58 [backport] Fixing i18n json serializer 2015-05-21 13:10:47 +02:00
Alejandro Alonso 3052ab3687 Fixing i18n json serializer 2015-05-21 13:10:15 +02:00
Alejandro Alonso 790337e814 [backport] Fixing users API 2015-05-21 12:28:33 +02:00
Alejandro Alonso 57b25f13f1 Fixing users API 2015-05-21 12:27:32 +02:00
Alejandro Alonso a3547db978 Merge branch 'master' into stable 2015-05-21 10:39:04 +02:00
David Barragán Merino 57ea22d5f7 Update CHANGELOG 2015-05-20 16:37:38 +02:00
David Barragán Merino 0c0e7961c8 Improve GH messages 2015-05-19 18:28:44 +02:00
David Barragán Merino 1bb9158cfa [i18n] Update locales 2015-05-16 16:07:52 +02:00
David Barragán Merino 0d14ad9b3d [i18n] Fix a typo 2015-05-15 18:07:28 +02:00
David Barragán Merino db46c67e6d [i18n] Fix some emails 2015-05-15 17:16:11 +02:00
David Barragán Merino 2cb5e9df19 [i18n] Localized emails 2015-05-14 15:04:35 +02:00
David Barragán Merino c4b26c8083 Update manage_translation script: add an action to regenerate .mo files 2015-05-14 15:03:49 +02:00
Alejandro Alonso 6b281f1839 Updating timeline serializer 2015-05-14 09:57:09 +02:00
Alejandro Alonso 0048f4d297 Fixing tag serializer in projects API 2015-05-14 09:07:22 +02:00
Alejandro Alonso b278fec279 [backport] Adding extra order fields to user stories API 2015-05-12 13:33:28 +02:00
Alejandro 3418b3e72b Merge pull request #326 from taigaio/issue/2646/import_is_broken
Fix importer
2015-05-12 10:42:09 +02:00
Alejandro Alonso bbfbeb8e69 Adding extra order fields to user stories API 2015-05-12 10:30:38 +02:00
Alejandro Alonso 45b675b393 Fixing big avatar size 2015-05-11 15:17:33 +02:00
David Barragán Merino c92df1d4e4 Fix importer 2015-05-11 12:40:40 +02:00
Alejandro Alonso 5cb2cbf032 [Backport] Adding sort fields to userstories API 2015-05-11 12:17:29 +02:00
David Barragán Merino e00922fe96 Merge pull request #327 from taigaio/issue-fix-user-story-neighbors-in-taskboard
Adding sort fields to userstories API
2015-05-11 12:14:28 +02:00
Alejandro Alonso 0ffa9eb449 Adding sort fields to userstories API 2015-05-11 11:59:09 +02:00
David Barragán Merino d1e22fc21b [i18n] Update locales 2015-05-11 11:57:53 +02:00
David Barragán Merino 1a0a714717 Merge pull request #325 from taigaio/user-stats
Adding API end point for user stats
2015-05-11 11:57:22 +02:00
Alejandro Alonso d4adfbcc3d Adding API end point for user stats 2015-05-11 11:55:54 +02:00
David Barragán Merino e12ad74846 Fix importer 2015-05-08 13:16:03 +02:00
David Barragán Merino 1600590351 [i18n] Download only current translations on commit 2015-05-08 11:12:21 +02:00
David Barragán Merino ffd0741d57 [i18n] Update locales 2015-05-08 11:11:44 +02:00
Alejandro 9c10fe64a4 Merge pull request #322 from taigaio/improvement/github_hooks_messages
Improve github hooks messages
2015-05-08 07:24:42 +02:00
David Barragán Merino 3e032622e3 Improve github hooks messages 2015-05-07 16:47:03 +02:00
Alejandro 9fcd418a4d Merge pull request #324 from taigaio/upgrades/django1.7.8
Upgrade Django to 1.7.8
2015-05-07 12:45:36 +02:00
Alejandro 97c119e2d7 Merge pull request #323 from taigaio/improvement/add_tags_to_csv_reoprts
Add tags field to CSV Reports
2015-05-07 12:45:10 +02:00
David Barragán Merino 0185904ef2 Upgrade Django to 1.7.8 2015-05-06 14:08:13 +02:00
David Barragán Merino 4e158810f4 Add tags field to CSV Reports 2015-05-06 12:49:05 +02:00
Alejandro Alonso c2563125e5 Fixing information disclosure when resetting password 2015-05-05 19:52:56 +02:00
Alejandro Alonso 2b469c560c Fixing information disclosure when resetting password 2015-05-05 19:52:34 +02:00
David Barragán Merino 9962ab12f9 Add some missed migrations 2015-05-05 18:40:20 +02:00
David Barragán Merino b23981f4be [i18n] Minor fixes in translations 2015-05-05 12:10:04 +02:00
David Barragán Merino bb2418cf21 Merge pull request #315 from taigaio/api-new-fields-for-home
Adding extra fields to userstories, tasks and issues APIs required in ho...
2015-05-04 12:10:40 +02:00
Alejandro Alonso 01eae65564 Adding extra fields to userstories, tasks and issues APIs required in home 2015-05-04 12:10:13 +02:00
David Barragán Merino dd43afa7ed [i18n] Update locales 2015-05-04 11:56:51 +02:00
David Barragán Merino 68a4b49e95 Update changelog 2015-05-04 11:56:36 +02:00
Alejandro Alonso d6de4090d6 Adding jitsy to meetup choices 2015-05-04 10:25:07 +02:00
Alejandro Alonso 9424beeb32 Adding static to gitignore 2015-05-04 07:43:38 +02:00
David Barragán Merino e054001a5c [i18n] Add Traditional Chinese locales 2015-05-03 23:44:04 +02:00
David Barragán Merino 995569cd5a [i18n] Add catalan locale 2015-05-01 03:32:10 +02:00
Alejandro Alonso 214a74163f Forcing DEBUG disabled in timeline command 2015-04-30 08:04:33 +02:00
Jonathan Barratt 9c1c582577 [backport] Uncomment the DATABASES dict in settings/local.py.example, and add a default PASSWORD value to it, in order to account for the addition of Postgresql authorization instructions to the setup-development docs (see https://github.com/taigaio/taiga-doc/issues/52) 2015-04-30 07:43:12 +02:00
Alejandro Alonso a1870ab5b1 Improving rebuild timeline command 2015-04-30 07:42:53 +02:00
Alejandro 33a49cecff Merge pull request #318 from reduxionist/add-postgresql-user-password
Uncomment the DATABASES dict in settings/local.py.example, and add a...
2015-04-30 07:41:51 +02:00
Jonathan Barratt 731d4f51c7 Uncomment the DATABASES dict in settings/local.py.example, and add a default PASSWORD value to it, in order to account for the addition of Postgresql authorization instructions to the setup-development docs (see https://github.com/taigaio/taiga-doc/issues/52) 2015-04-29 20:51:11 +07:00
David Barragán Merino eaaee62f8c Update CHANGELOG 2015-04-29 13:53:42 +02:00
David Barragán Merino 7e86aca66e [i18n] Add finish translation 2015-04-29 13:45:01 +02:00
Alejandro Alonso 3056ef78e6 Improving rebuild timeline command 2015-04-29 11:23:22 +02:00
Alejandro Alonso f5f3cff234 Improving timeline migration and regeneration 2015-04-29 10:19:34 +02:00
Alejandro Alonso 6fa64d191a Improving projects order_by in user order 2015-04-29 09:52:58 +02:00
Alejandro 42da513ad5 Merge pull request #317 from taigaio/issue/2614/change_us_points_from_15_to_13
tg-2615 #ready-for-test: Change us points 15 to 13 in template fixture
2015-04-29 08:55:41 +02:00
David Barragán Merino 3cdfcc3e90 tg-2615 #ready-for-test: Change us points 15 to 13 in template fixture 2015-04-28 16:28:41 +02:00
David Barragán Merino 66a7c322bb Merge pull request #311 from taigaio/adding-tag-support-for-projects
Adding tag support for projects
2015-04-28 14:22:05 +02:00
Alejandro Alonso 58734af321 Adding tag support for projects 2015-04-28 14:21:45 +02:00
David Barragán Merino f0d53c7bd7 Merge pull request #312 from taigaio/user-contacts-API
User contacts API
2015-04-28 14:19:02 +02:00
Alejandro Alonso 30a5cb3faa User contacts API 2015-04-28 14:18:38 +02:00
David Barragán Merino 6c60f5d849 Remove a print sentence 2015-04-28 13:44:38 +02:00
Alejandro Alonso 38855a00cb [Backport] Adding is_archived info to templates export 2015-04-28 13:43:22 +02:00
David Barragán Merino c8da398b96 Merge pull request #316 from taigaio/issue-2605-is-archived-bug-in-templates
Adding is_archived info to templates export
2015-04-28 13:40:50 +02:00
Alejandro Alonso 2d904165cb Adding is_archived info to templates export 2015-04-28 12:40:11 +02:00
Alejandro Alonso 55edab031c Adding is_assigned, watchers and status__is_closed filters to user stories, tasks and issues APIs 2015-04-27 08:17:23 +02:00
David Barragán Merino 2b54857146 [i18n] Translate role_name in Member*Serrializer 2015-04-23 20:57:52 +02:00
David Barragán Merino 01cfa593e5 [i18n] Translate RoleSerrializer.name 2015-04-23 20:12:30 +02:00
David Barragán Merino 1be3fb56c7 [i18n] Update spanish locales 2015-04-23 19:07:43 +02:00
David Barragán Merino 51729766bb Merge pull request #306 from taigaio/ordering-user-projects
Enabling ordering in user projects
2015-04-21 20:21:34 +02:00
Alejandro Alonso 86108b0314 Enabling ordering in user projects 2015-04-21 17:22:07 +02:00
David Barragán Merino 203e349f20 Merge pull request #301 from taigaio/timeline
Timeline
2015-04-21 17:17:30 +02:00
David Barragán Merino 17b5f0e310 Make some errors translateables 2015-04-21 16:31:11 +02:00
Alejandro Alonso c5b268aa75 Adding extra info to timeline API 2015-04-21 16:21:36 +02:00
Alejandro Alonso c77ee9f0ad Renaming wiki_page to wikipage in timelines 2015-04-21 16:21:36 +02:00
Alejandro Alonso cb654e56b5 Updating timeline migrations 2015-04-21 16:21:36 +02:00
Alejandro Alonso ccd32158f4 Adding milestone info to timeline API 2015-04-21 16:21:36 +02:00
Alejandro Alonso ce3d9aaf48 Import and export timelines 2015-04-21 16:21:36 +02:00
Alejandro Alonso f3d1de684d Adding team members notification 2015-04-21 16:21:36 +02:00
Alejandro Alonso c1543ac95c Adding description for projects in timelines 2015-04-21 16:21:36 +02:00
Alejandro Alonso 22db4ef8e7 Fixing migration 2015-04-21 16:21:36 +02:00
Alejandro Alonso 9589bba63b Adding ref data to timeline API 2015-04-21 16:21:35 +02:00
Alejandro Alonso 4e25b5fa97 Updating tests and adding new ones for timeline 2015-04-21 16:21:35 +02:00
Alejandro Alonso f322dff050 Updating sample data 2015-04-21 16:21:35 +02:00
Alejandro Alonso 1d701a7cad Updating timeline API 2015-04-21 16:21:35 +02:00
Alejandro Alonso 982d79d8aa Refactoring timeline 2015-04-21 16:21:35 +02:00
Alejandro Alonso 872e274825 Adding HistoryResourceMixin to projects API 2015-04-21 16:21:35 +02:00
David Barragán Merino a70bb058bd Add bidi (right-to-left layout) attr to locale resource 2015-04-21 13:24:37 +02:00
Alejandro Alonso b79cab7cde Removing old resource from tx config 2015-04-21 11:07:26 +02:00
Alejandro Alonso 289995f7b8 Updating for new transifex release 2015-04-21 11:07:26 +02:00
David Barragán Merino 36d7c1ab1a Minor fixes in settings 2015-04-20 12:23:20 +02:00
David Barragán Merino 7136966474 Disabled unused languages 2015-04-17 12:40:00 +02:00
David Barragán Merino b998857758 Minor fixes in translation script 2015-04-17 12:37:43 +02:00
David Barragán Merino 97cc401e29 Add spanish and french translations 2015-04-17 12:27:11 +02:00
David Barragán Merino e80897473b Fix manage_translations.py lang_stats 2015-04-16 11:46:14 +02:00
Alejandro Alonso 2d6a436e80 [backport] Fixing gravatar default avatar 2015-04-15 15:07:25 +02:00
Alejandro Alonso 59750ff7d2 Fixing gravatar default avatar 2015-04-15 15:06:47 +02:00
Alejandro ace8e373c7 Merge pull request #290 from taigaio/us/1475/internationalization
i18n
2015-04-15 10:52:42 +02:00
David Barragán Merino 76127c0c6c Update CHANGELOG 2015-04-15 07:26:24 +02:00
David Barragán Merino da0712be81 User.lang must be empty 2015-04-15 07:26:24 +02:00
Alejandro Alonso 9ef2f709c7 i18n for default taiga names 2015-04-15 07:26:24 +02:00
David Barragán Merino 13def945c6 Add locales resource 2015-04-14 16:28:57 +02:00
David Barragán Merino 99fa3c4823 Remove _main_ resource. Languages list isn't translateable 2015-04-14 11:15:15 +02:00
David Barragán Merino d4433d3af4 Fix some typos 2015-04-14 11:15:15 +02:00
David Barragán Merino 910d71eefc Add code of django-restframwork to taiga 2015-04-14 11:15:15 +02:00
David Barragán Merino d3fade9565 Add gettext to translatable strings 2015-04-09 15:25:40 +02:00
David Barragán Merino 2d960c7a5d i18n in emails 2015-04-09 15:24:43 +02:00
David Barragán Merino 027e15475d Add manage_translations script 2015-04-09 15:24:43 +02:00
David Barragán Merino 2c16c858f9 Add license 2015-04-08 19:20:32 +02:00
Alejandro 85819d2f32 Merge pull request #294 from taigaio/fix-dump-load-membership-uuid
Force regenerate invitations uuids on dump load
2015-04-08 09:36:58 +02:00
David Barragán Merino 6b294c4ca9 Remove unnecessary command 2015-04-07 23:36:32 +02:00
Jesús Espino 8868e89d6f Force regenerate invitations uuids on dump load 2015-04-07 17:13:55 +02:00
Alejandro Alonso 805ceecc65 [backport] Fixing custom attributes notifications on name change 2015-04-07 14:18:31 +02:00
Alejandro Alonso 7beff9cab7 Fixing custom attributes notifications on name change 2015-04-07 14:18:05 +02:00
David Barragán Merino 7302af8eb7 Add copyright and license terms 2015-03-27 12:55:37 +01:00
David Barragán Merino c178aacdb2 Update djmail to 0.10 2015-03-26 12:42:41 +01:00
David Barragán Merino 466a17c1c0 Update requirements-devel.txt 2015-03-26 12:05:55 +01:00
Jesús Espino 97f25afcb3 [backport] Fixed vhost name on Events rabbitmq backend 2015-03-23 13:06:58 +01:00
Jesús Espino d2ba8b4327 Fixed vhost name on Events rabbitmq backend 2015-03-23 13:06:36 +01:00
Alejandro Alonso 545b56d450 [Backport] Fixing empty body bug in gitlab webhooks 2015-03-23 10:14:25 +01:00
David Barragán Merino 63319deb14 Merge pull request #288 from taigaio/Fixing-empty-body-bug-in-gitlab-webhooks
Fixing empty body bug in gitlab webhooks
2015-03-23 10:12:40 +01:00
Alejandro Alonso fcd5ccbd74 Fixing empty body bug in gitlab webhooks 2015-03-23 08:31:48 +01:00
Alejandro Alonso 947ded12ae [backport] Fixing migration 2015-03-18 16:01:03 +01:00
Alejandro Alonso b15601be75 Fixing migration 2015-03-18 16:00:13 +01:00
David Barragán Merino c808e0d709 [backport] Fix visualization of blocked_note and is_blokked fields 2015-03-18 15:05:27 +01:00
Alejandro 016ed86aa0 Merge pull request #285 from taigaio/issue/2457/patch_blocked_data_in_history
Fix visualization of blocked_note and is_blokked fields
2015-03-18 15:01:15 +01:00
David Barragán Merino 74aa4e5891 Fix visualization of blocked_note and is_blokked fields 2015-03-18 14:55:44 +01:00
Alejandro Alonso a20542fad9 [Backport] Fixing empty body bug in github webhooks 2015-03-18 14:43:35 +01:00
David Barragán Merino 59869b68f8 Merge pull request #286 from taigaio/Fixing-empty-body-bug-in-github-webhooks
Fixing empty body bug in github webhooks
2015-03-18 14:42:37 +01:00
Alejandro Alonso 3877411c41 Fixing empty body bug in github webhooks 2015-03-18 13:52:56 +01:00
Jesús Espino c78f5e34c3 [backport] Temporary disable public projects on listings 2015-03-18 12:05:56 +01:00
Alejandro a1e2a9457e Merge pull request #284 from taigaio/temporary-filter-public-projects
Temporary disable public projects on listings
2015-03-18 12:01:28 +01:00
Jesús Espino 5a45db23fc Temporary disable public projects on listings 2015-03-18 11:35:06 +01:00
Jesús Espino 2a83cb73e8 Adding charset utf-8 to all csv exports content-type header 2015-03-17 12:48:46 +01:00
Alejandro Alonso d9a8c934b0 Merge branch 'master' into stable 2015-03-17 10:57:11 +01:00
Alejandro Alonso 5b9bf40694 Updating CHANGELOG 2015-03-17 10:54:10 +01:00
David Barragán Merino 8530967aea Merge pull request #281 from taigaio/bug/2445/losed-stimations-when-deleting-values
Updating stimaations properly when removing a points value
2015-03-16 11:38:20 +01:00
Alejandro Alonso d27abf91ac Updating stimaations properly when removing a points value 2015-03-16 10:15:08 +01:00
David Barragán Merino 392e10a057 Update CHANGELOG 2015-03-14 12:10:54 +01:00
Alejandro Alonso 4d4b52075e Bug 2444 links in rich content editor 2015-03-13 15:01:56 +01:00
David Barragán Merino 5271e1c043 Merge pull request #279 from taigaio/bug-2419-the-system-tries-sending-emails-to-inactive-users
Bug 2419 - The system tries sending emails to inactive users
2015-03-13 10:06:26 +01:00
Alejandro Alonso 91f51cddf9 Bug 2419 - The system tries sending emails to inactive users 2015-03-13 10:05:24 +01:00
David Barragán Merino be163c894d Merge pull request #278 from taigaio/fixed-members-filter
Fix MembersFilter of Users api, now filter correctly and filter by is_ac...
2015-03-12 11:11:09 +01:00
Jesús Espino be4d0c6d06 Fix MembersFilter of Users api, now filter correctly and filter by is_active 2015-03-12 10:29:32 +01:00
Alejandro 65a6a2dcb6 Merge pull request #277 from taigaio/bug/2390/public_project_listed
Allowing to filter projects by membership
2015-03-12 07:53:26 +01:00
Jesús Espino ed01cbd3a7 BUG#2390 Allowing to filter projects by membership 2015-03-11 17:04:54 +01:00
David Barragán Merino d3f9cfa4f5 Fix #2401: Github integration error 2015-03-11 14:57:08 +01:00
Alejandro Alonso 2d1300e56b Adding lost migration 2015-03-11 09:21:49 +01:00
David Barragán Merino 71ef2e0212 Merge pull request #275 from taigaio/hiding-email
Hide email to not-admin users
2015-03-10 23:45:27 +01:00
Alejandro Alonso 4b6e839388 Fixing membership creation serialization 2015-03-10 23:12:07 +01:00
Jesús Espino f1ddd0a935 Hide email to not-admin users 2015-03-10 19:19:32 +01:00
David Barragán Merino 6e780bb720 Merge pull request #263 from taigaio/us/1913/csv-reports
US#1913: CSV Reports
2015-03-10 19:11:22 +01:00
Jesús Espino 4440e7848d Fixed special case of serializer selection 2015-03-10 18:12:02 +01:00
Alejandro Alonso bdcd8bba41 Adding custom fields to csv exrpot 2015-03-10 18:11:50 +01:00
Jesús Espino 9908d4307a Fix the show of csv exports uuid on project serialized data 2015-03-10 17:57:08 +01:00
Jesús Espino 4e9d4610fe Fixed tests 2015-03-10 17:57:08 +01:00
David Barragán Merino 5e184120f7 Disable generations of csvs uuids 2015-03-10 17:57:08 +01:00
David Barragán Merino 25fa034e80 Fix a conflict between migrations 2015-03-10 17:57:08 +01:00
Jesús Espino 66e6512245 US#1913: CSV Reports 2015-03-10 17:57:08 +01:00
Alejandro Alonso d984557449 Updating local.py.example with required database backend 2015-03-10 14:27:21 +01:00
David Barragán Merino 8f37048a55 Update CHANGELOG 2015-03-10 09:32:12 +01:00
David Barragán Merino bd0b162a0e Update django to 1.7.6 2015-03-10 09:27:16 +01:00
Alejandro Alonso 208bf87997 Adding public projects to sample_data 2015-03-10 08:54:40 +01:00
Alejandro Alonso 1a457ea8c5 Updating public permission choices 2015-03-09 15:35:04 +01:00
David Barragán Merino f21b5ecd4a Update CHANGELOG 2015-03-09 14:00:16 +01:00
David Barragán Merino 92c1c39790 Merge pull request #260 from taigaio/public-projects
Public projects
2015-03-09 12:49:02 +01:00
Alejandro Alonso cff56f1d86 Fixing is_private attribute 2015-03-09 12:48:14 +01:00
Alejandro Alonso 44e6f7c42d Updating anon and public permissions when project is public 2015-03-09 12:48:14 +01:00
Alejandro Alonso 79e9682531 Updating permissions for supporting public projects 2015-03-09 12:48:14 +01:00
David Barragán Merino efc666c793 Ignore .env file 2015-03-09 12:44:54 +01:00
Alejandro 336d141656 Merge pull request #242 from taigaio/us/55/custom-fields
US #55: Custom fields
2015-03-04 14:27:22 +01:00
David Barragán Merino 5dfd88274b US #55: Custom fields - Send email notifications 2015-03-04 12:59:28 +01:00
David Barragán Merino d56ee49064 US #55: Custom fields - Change the name of a var 2015-03-04 12:59:28 +01:00
David Barragán Merino 7ef5a3a9d9 US #55: Custom fields - Minor refactor 2015-03-04 12:59:28 +01:00
Jesús Espino f9cbc36303 Fixing issues and task tests 2015-03-04 12:59:28 +01:00
Jesús Espino 618a731019 Fixing some tests 2015-03-04 12:59:28 +01:00
David Barragán Merino 462638db5e US #55: Custom fields - Update CHANGELOG 2015-03-04 12:59:28 +01:00
David Barragán Merino ffe04f2bab US #55: Custom fields - Fix asome error when generate diff in history model 2015-03-04 12:59:28 +01:00
David Barragán Merino be6e03226b US #55: Custom fields - Webhooks 2015-03-04 12:59:28 +01:00
David Barragán Merino 4368323165 US #55: Custom fields - Improve API queries 2015-03-04 12:59:28 +01:00
David Barragán Merino 9193c78de5 US #55: Custom fields - Permissions tests over custom attributes values 2015-03-04 12:59:28 +01:00
David Barragán Merino 892f6f93df US #55: Custom fields - Fix validations 2015-03-04 12:59:28 +01:00
David Barragán Merino 47a4c5e0e7 US #55: Custom fields - Fix a bug with the 🐯s 2015-03-04 12:59:28 +01:00
David Barragán Merino 61c973057a US #55: Custom fields - Fix mixins order in CustomAttribute ViewSets 2015-03-04 12:59:28 +01:00
David Barragán Merino e8078aaaa5 US #55: Custom fields - Create empty CustomAttributesValues when added USs, Tasks and Issues 2015-03-04 12:59:28 +01:00
David Barragán Merino 3369fa41f0 US #55: Custom fields - Fix custo attribute serializer validator of name 2015-03-04 12:59:28 +01:00
David Barragán Merino df8c532cbd US #55: Custom fields - Exclude id in CustomAttributesValues serializers 2015-03-04 12:59:28 +01:00
David Barragán Merino 5eddda9803 US #55: Custom fields - Fix a problem with serializer classes and mixins 2015-03-04 12:59:27 +01:00
David Barragán Merino 22e62b4f65 US #55: Custom fields - Change 'values' field in CustomAttributesValues models to 'attributes_values' 2015-03-04 12:59:27 +01:00
Alejandro Alonso d1d0825d2e US #55: Custom fields - Adding info about custom fields to project serializer 2015-03-04 12:59:27 +01:00
David Barragán Merino eedd2ca7d5 US #55: Custom fields - Use custom attributes and values in sample_data cvommand 2015-03-04 12:59:27 +01:00
David Barragán Merino 56b9fe42e3 US #55: Custom fields - Import/Export custom attributes values 2015-03-04 12:59:27 +01:00
David Barragán Merino 32ff494ddd US #55: Custom fields - 3️⃣ 😩 🐯 2015-03-04 12:59:27 +01:00
David Barragán Merino 2893213932 US #55: Custom fields - Create model to save the custom attributes values and update the history 2015-03-04 12:59:27 +01:00
David Barragán Merino ebc3388d03 US #55: Custom fields - Import/Export custom attributes 2015-03-04 12:59:27 +01:00
David Barragán Merino 84db9956d5 US #55: Custom fields - Tests 2015-03-04 12:59:27 +01:00
David Barragán Merino c17157f8ec US #55: Custom fields - Create API end point 2015-03-04 12:59:27 +01:00
David Barragán Merino 38d4eacd76 US #55: Custom fields - Create admin 2015-03-04 12:59:27 +01:00
David Barragán Merino bc473375ba US #55: Custom fields - Create model 2015-03-04 12:59:27 +01:00
Alejandro Alonso 536741ae53 Fixing lost import 2015-03-04 11:38:32 +01:00
Alejandro d8fa37677d Merge pull request #271 from taigaio/issue/2332/add-toc-extension-to-markdown-render
Issue #2332 - Add TOC extension to the markdown render
2015-03-04 08:42:20 +01:00
David Barragán Merino 64ba841e53 Merge pull request #270 from taigaio/fix-snapshot-not-null-restriction
Fixing badly created restriction
2015-03-04 00:06:00 +01:00
David Barragán Merino dfa0f875d5 Issue #2332 - Add TOC extension to the markdown render 2015-03-03 14:45:57 +01:00
Alejandro Alonso 42832511ed Fixing badly created restriction 2015-03-03 14:22:58 +01:00
Jesús Espino 98d77a4628 Adding the hipchat plugin to the changelog 2015-02-25 12:08:44 +01:00
David Barragán Merino 3dc143149f Merge pull request #266 from taigaio/more-flake8-fixes
Some flake8 fixes
2015-02-24 19:55:27 +01:00
Jesús Espino 47c338324e Some flake8 fixes 2015-02-24 19:55:02 +01:00
David Barragán Merino 3ba3c8978b Merge pull request #265 from taigaio/tests-flake8
Fixing a lot of flake8 errors on tests
2015-02-24 19:54:31 +01:00
Jesús Espino c328414b4d Fixing a lot of flake8 errors on tests 2015-02-24 19:54:10 +01:00
Jesús Espino 1ba41671b4 Merge pull request #267 from astagi/feature/fixtypocreated
Use create instead of created
2015-02-24 18:34:02 +01:00
Andrea Stagi beafa2d2e3 Use create instead of created 2015-02-24 17:52:50 +01:00
David Barragán Merino 39d2faba80 Merge pull request #264 from taigaio/moving-github-tests-to-contrib-repo
Moving tests from taiga-back to the plugin repository
2015-02-24 13:34:37 +01:00
Jesús Espino 8e69be800e Fixed duplications and flake8 errors on factories.py 2015-02-24 13:13:24 +01:00
Jesús Espino f30b8f8451 Moving tests from taiga-back to the plugin repository 2015-02-24 13:10:57 +01:00
David Barragán Merino f398501fb8 Refactor some tests (II) - Remove debug trace 2015-02-24 12:14:29 +01:00
David Barragán Merino 6db1eca874 Refactor some tests 2015-02-24 11:28:01 +01:00
David Barragán Merino e81f2b36ae Merge pull request #255 from taigaio/events-after-commit
Using transaction hooks to emit to taiga-events only after database comm...
2015-02-19 16:05:07 +01:00
Jesús Espino 7f26677c07 Using transaction hooks to emit to taiga-events only after database commit 2015-02-19 16:04:51 +01:00
David Barragán Merino 4660ee9ad0 Merge pull request #262 from taigaio/issue/1732/user-story-change-freeze
Fix #1732: Now the task freezer implements the user story values
2015-02-19 16:01:11 +01:00
Jesús Espino 802d2b40ec Fix #1732: Now the task freezer implements the user story values 2015-02-19 11:03:06 +01:00
Jesús Espino 871d9d6963 SmallFix: Add necesary imports 2015-02-18 09:54:50 +01:00
Jesús Espino 6edb4afee4 Fix small bug on permissions check of wiki pages for anonymous users 2015-02-18 09:34:39 +01:00
Jesús Espino 20f9f47b00 [backport] Incremented django-transanctional-cleanup to 0.1.14 version 2015-02-18 08:35:22 +01:00
Jesús Espino b8ac3e7937 Incremented django-transanctional-cleanup to 0.1.14 version 2015-02-18 08:35:00 +01:00
David Barragán Merino 67dfba539f Update README.md: Use badgets of master branch 2015-02-18 01:00:03 +01:00
David Barragán Merino 8b72fb20d1 Merge pull request #258 from taigaio/bug/2249/not-close-empty-sprints
TG-2249 #ready-for-test: Now the empty sprints aren't closed
2015-02-17 20:05:19 +01:00
Jesús Espino 8875f2c0d9 TG-2249 #ready-for-test: Now the empty sprints aren't closed 2015-02-17 16:02:21 +01:00
Jesús Espino 7a4864da5e Incremented taiga-contrig-github-auth requirement 2015-02-17 13:07:21 +01:00
Jesús Espino 94d35aac11 Fixed some flake8 errors 2015-02-17 12:53:19 +01:00
Jesús Espino 0905753b0c Moving response generation from auth plugin services to auth api 2015-02-17 12:47:58 +01:00
Jesús Espino 6553b4d8dc Merge pull request #250 from taigaio/refactor/bameda-style
Refactor day: @bameda style
2015-02-17 12:45:30 +01:00
David Barragán Merino 60ab6127aa Refactor day: Use taiga.base.response instead rest_framework.response 2015-02-17 12:25:37 +01:00
David Barragán Merino 5196f1c25d Refactor day: Move RoleViewSet from taiga.projects to taiga.users 2015-02-16 20:04:41 +01:00
David Barragán Merino 589490d7a5 Update django to 1.7.4 and update dev requirements 2015-02-16 19:24:10 +01:00
Alejandro Alonso 147ebbdbbd Fixing bug 2195 - Notifications about points, from and to in incorrect order 2015-02-16 08:56:13 +01:00
David Barragán Merino 3e4e217ec1 Add migration for new user contrib plugins enhacement 2015-02-13 18:02:33 +01:00
David Barragán Merino e937f91245 Update README.md 2015-02-13 10:00:46 +01:00
David Barragán Merino 65c322a85b Update README.md 2015-02-12 09:12:09 +01:00
David Barragán Merino 357d7706a1 Upgrade django-pgjson to 0.2.2 2015-02-11 13:36:47 +01:00
David Barragán Merino 6cf529760d Fix fixture: remove github_id 2015-02-11 13:35:55 +01:00
David Barragán Merino 58e17611e4 Merge pull request #240 from taigaio/bug/2150/bad-field-names-in-email-notifications
Fixing fields in notification emails and lists contents
2015-02-11 11:34:46 +01:00
Alejandro Alonso 3ca137bed0 Fixing fields in notification emails and lists contents 2015-02-11 11:34:27 +01:00
David Barragán Merino 2d69b244b6 Merge pull request #239 from taigaio/bug/2083/user-story-history-repeats-files-and-has-no-order
Locking the element on take_snapshot to avoid racing condition issues
2015-02-11 11:33:38 +01:00
Alejandro Alonso 50fd9b6161 Locking the element on take_snapshot to avoid racing condition issues 2015-02-11 11:10:37 +01:00
David Barragán Merino 985838cd1a Merge pull request #247 from taigaio/refactor/auth-modules
Refactor/auth modules
2015-02-11 11:04:28 +01:00
Jesús Espino c517a8519c Allow auth plugins 2015-02-11 09:36:56 +01:00
David Barragán Merino dd5cff35cf Merge pull request #252 from taigaio/refactor/remove-obsolete-settings
Remove obsolete settings variables
2015-02-10 19:49:28 +01:00
Jesús Espino 26ba8e1a07 Remove obsolete settings variables 2015-02-10 19:49:16 +01:00
David Barragán Merino e14be84527 Merge pull request #248 from taigaio/refactor/2229-standardize-title-fields
Fix wiki reference link title attribute
2015-02-10 19:34:37 +01:00
Jesús Espino 78f5dc35c8 [backport] Updated django-transactional-cleanup version 2015-02-10 19:00:13 +01:00
Jesús Espino 47a0b46b5e Updated django-transactional-cleanup version 2015-02-10 18:59:57 +01:00
Jesús Espino d98e9a2fc7 Fix wiki reference link title attribute 2015-02-10 17:17:16 +01:00
Jesús Espino 62f547c282 Merge pull request #246 from taigaio/upgrades/django-pgjson
Upgrade django-pgjson to 0.2.1
2015-02-09 16:16:49 +01:00
David Barragán Merino 6e13e774d6 Upgrade django-pgjson to 0.2.1 2015-02-09 16:11:31 +01:00
David Barragán Merino 8858c8b782 Revert "Update django-pgjson from 0.2.0 to 0.2.1"
This reverts commit 67ef7de61f.
2015-02-07 00:57:50 +01:00
David Barragán Merino 67ef7de61f Update django-pgjson from 0.2.0 to 0.2.1 2015-02-07 00:26:36 +01:00
David Barragán Merino 951dd14d30 Update AUTHORS 2015-02-06 14:51:53 +01:00
David Barragán Merino e29fa14a56 Update README.md 2015-02-05 13:23:21 +01:00
Alejandro d82418b156 Merge pull request #241 from taigaio/refactor/project_api
Refactors over taiga.projects.api
2015-02-04 14:27:42 +01:00
David Barragán Merino e9093a0567 Refactors over taiga.projects.api:
- use taiga.base instead rest_framework,
 - move some mixins to taiga.projects.mixins.

Fix a typo in taiga.projects.permissions.
2015-02-04 14:04:49 +01:00
Jesús Espino fbb29666b7 Added users_me resource permissions test 2015-02-03 13:36:07 +01:00
Jesús Espino f4856f95ee Merge pull request #236 from astagi/feature/me
Add users me endpoint
2015-02-03 13:34:44 +01:00
Jesús Espino b0182ad7de Merge pull request #233 from taigaio/bug/1972/tasks-should-retain-all-history-in-their-full-view
Tasks should retain all history in their full view
2015-02-03 13:02:52 +01:00
Alejandro Alonso 5a97d41a48 Tasks should retain all history in their full view 2015-02-03 13:02:49 +01:00
Jesús Espino 8266b67560 [backport] Fixing importing userstories promoted from issues 2015-02-03 12:06:00 +01:00
Jesús Espino acab7fcdfb Fixing importing userstories promoted from issues 2015-02-03 12:05:40 +01:00
David Barragán Merino a97fd2a91e Improve update-role-points test 2015-02-03 10:26:41 +01:00
Alejandro Alonso 992d20d100 [Backport] Fixing problem when PATCH in a resource using prefetch_related 2015-02-03 10:17:14 +01:00
David Barragán Merino 213854d8d5 Merge pull request #237 from taigaio/bug/2133/I-cannot-remove-myself-from-watchers
Fixing problem when PATCH in a resource using prefetch_related
2015-02-03 10:16:06 +01:00
Alejandro Alonso 7558bbee79 Fixing problem when PATCH in a resource using prefetch_related 2015-02-03 09:54:51 +01:00
Andrea Stagi f7887798d1 Add users me endpoint 2015-02-03 00:12:44 +01:00
Jesús Espino 2016586afa Merge pull request #215 from taigaio/issue/1886/500_api_filter_by_project_slug
Issue #1886: Bad request when use project.slug instead project.id in API...
2015-02-02 18:10:02 +01:00
David Barragán Merino 268b6a7ad4 Issue #1886: Bad request when use project.slug instead project.id in API calls 2015-02-02 18:05:21 +01:00
Jesús Espino dcb98e7c23 Merge pull request #227 from taigaio/issue/2098-search_error
HTTP 404 for calls to search api with a wront project_id
2015-02-02 16:33:47 +01:00
David Barragán Merino d4a40ad8d3 HTTP 404 for calls to search api with a wront project_id 2015-02-02 16:14:30 +01:00
Jesús Espino c2416dd622 Merge pull request #228 from taigaio/refactor/use_our_get_object_or_404_function
Use our get_object_or_404 function instead the django one
2015-02-02 16:10:27 +01:00
Alejandro Alonso d8df2aeca6 [backport] Bug 2143 ordering the changes in notification emails 2015-02-02 14:54:36 +01:00
Alejandro Alonso f275ea9b5a Bug 2143 ordering the changes in notification emails 2015-02-02 14:54:07 +01:00
Alejandro Alonso b0f3dcd9df [backport] Adding lost webhooks migration 2015-02-02 09:40:30 +01:00
Alejandro Alonso c6b1906378 Adding lost webhooks migration 2015-02-02 09:40:11 +01:00
Alejandro Alonso 07367b91ed [backport] Fixing diff emails 2015-02-02 09:18:50 +01:00
Alejandro Alonso 252f01c96c Fixing diff emails 2015-02-02 09:18:33 +01:00
David Barragán Merino 560ccec62e Update CHANGELOG 2015-01-31 16:29:48 +01:00
Jesús Espino fabbfa8b8d [backport] Fix another problem in export/import system 2015-01-31 11:17:23 +01:00
Jesús Espino 379283e5ac Fix another problem in export/import system 2015-01-31 11:17:07 +01:00
Jesús Espino 319ac1dfb2 [backport] Some fixes on export-import 2015-01-29 18:49:01 +01:00
Jesús Espino a562c39168 Some fixes on export-import 2015-01-29 18:48:38 +01:00
Jesús Espino cc046b5555 Add lxml to requirements.txt file 2015-01-29 13:05:07 +01:00
Jesús Espino be710a4545 Merge branch 'master' into stable
Conflicts:
	taiga/projects/serializers.py
2015-01-29 11:50:03 +01:00
Alejandro Alonso d753f61a57 Updating date in CHANGELOG 2015-01-29 11:28:30 +01:00
Alejandro Alonso 80661af35b Updating CHANGELOG 2015-01-29 11:25:43 +01:00
David Barragán Merino e995b7e3c4 Use our get_object_or_404 function instead the django one 2015-01-29 10:31:41 +01:00
David Barragán Merino 4cb62f2022 Fix indent 2015-01-28 10:12:52 +01:00
David Barragán Merino 954cb2bb0f Fix import and export emails 2015-01-27 20:03:14 +01:00
Jesús Espino 7fc8d32027 Adding ordering to webhooklog and webhooks 2015-01-26 18:06:39 +01:00
Jesús Espino 955a80213a Merge pull request #218 from taigaio/email-trans
Translate and fix all emails
2015-01-26 10:58:12 +01:00
Jesús Espino f106c5d6c0 Show deletion_datetime in localized format (in the future will take the language) and with timezone 2015-01-26 09:44:57 +01:00
David Barragán Merino 006dbd7278 Fix tests 2015-01-26 09:44:57 +01:00
Xavier Julián 97d8ee0bc5 Minor fixes in emails 2015-01-26 09:44:57 +01:00
David Barragán Merino 0d591dcadc Translate and fix all emails 2015-01-26 09:44:57 +01:00
Alejandro 8549b7328b Merge pull request #223 from taigaio/sync-calls-for-resend-and-test-in-webhooks
Now webhook test and webhooklog resend endpoints return the generated we...
2015-01-23 08:37:13 +01:00
David Barragán Merino 90d5eb88e9 Update test_importer_api.py 2015-01-22 21:18:12 +01:00
David Barragán Merino 779a2542d3 Update test_exporter_api.py 2015-01-22 21:15:59 +01:00
David Barragán Merino 62d627beb4 Use _ instead - in response.data 2015-01-22 18:43:57 +01:00
Jesús Espino 37ed0c13dc Merge pull request #224 from taigaio/feedback-emails/set-reply-to
Set reply-to to feedback emails
2015-01-22 16:52:04 +01:00
Jesús Espino 97cec70d55 Now webhook test and webhooklog resend endpoints return the generated webhooklog object 2015-01-22 16:39:17 +01:00
David Barragán Merino 415f8b35d2 Set reply-to to feedback emails 2015-01-22 15:50:32 +01:00
Alejandro 00d94cdeca Merge pull request #222 from taigaio/adding-name-to-webhooks-and-logs-counter-to-API
Adding name to webhooks and logs_counter to webhooks API
2015-01-22 13:13:32 +01:00
Jesús Espino 5b7cb4b13b Add extra data to the WebhookLog model (headers, duration, and creation date) 2015-01-22 12:53:01 +01:00
Alejandro Alonso da156401b0 Adding name to webhooks and logs_counter to webhooks API 2015-01-22 12:53:01 +01:00
David Barragán Merino 6032ed6c34 Remove an i 2015-01-22 09:31:23 +01:00
David Barragán Merino 8c6588b17a Make human-friendly the name of the dump files and xut some long lines 2015-01-21 15:44:48 +01:00
David Barragán Merino df20fc7f45 Update changelog 2015-01-21 15:07:20 +01:00
David Barragán Merino 1a68998a36 Merge pull request #221 from taigaio/import-api-in-synchronous-mode-returns-project-info
Import API in synchronous mode now returns the new project serialized
2015-01-21 12:08:27 +01:00
Alejandro Alonso 395c35628e Import API in synchronous mode now returns the new project serialized 2015-01-21 11:49:41 +01:00
Alejandro 073ec13373 Merge pull request #219 from taigaio/contrib-plugins
Adding initial contrib modules system
2015-01-21 09:56:46 +01:00
Jesús Espino 1afe78da8f Adding initial contrib modules system 2015-01-20 17:03:02 +01:00
David Barragán Merino 6f4c5a93df Merge pull request #220 from taigaio/refactoring-project-export
Refactoring project export
2015-01-20 11:27:33 +01:00
Alejandro Alonso 5a53e8f78a Refactoring project export 2015-01-20 10:52:39 +01:00
David Barragán Merino e77d2ba783 Ignore .project 2015-01-19 12:26:57 +01:00
David Barragán Merino c0af3a1acf Add license 2015-01-15 18:20:26 +01:00
Alejandro 2fba748487 Merge pull request #209 from taigaio/us/1678/webhooks
US #1678: Add webhooks to the backend
2015-01-14 16:28:42 +01:00
Jesús Espino 47107eb079 US #1678: Add webhooks to the backend 2015-01-14 16:04:22 +01:00
Alejandro 9cc6af9bd6 Merge pull request #203 from taigaio/us/1517/attachment-delete
Add django-transactional-cleanup and configure it
2015-01-14 12:26:58 +01:00
Jesús Espino 6e39a8f7a8 Add django-transactional-cleanup and configure it 2015-01-14 11:57:00 +01:00
David Barragán Merino 834d8dfe3f Use taiga.base.utils.json instead json 2015-01-14 10:54:42 +01:00
Alejandro Alonso b04c220451 Adding lost migrations 2015-01-14 10:54:16 +01:00
Jesús Espino 3403b4c848 Merge pull request #214 from taigaio/issue/1734/change_pasword_github_users
Issue #1734: currentPassword is not needed for github users
2015-01-14 08:21:53 +01:00
David Barragán Merino e81a73e24b Issue #1734: currentPassword is not needed for github users 2015-01-14 08:20:59 +01:00
David Barragán Merino 64dde7870d Remove unnecessary import 2015-01-13 19:10:13 +01:00
Alejandro 97fa6bca56 Merge pull request #204 from taigaio/us/1233/expose-import-export
Us/1233/expose import export
2015-01-13 14:03:50 +01:00
Jesús Espino a8afd77f89 Add import/export functionality to the API 2015-01-13 13:43:09 +01:00
Alejandro Alonso e81cafb3e3 Fixing invitation email 2015-01-13 13:35:59 +01:00
Alejandro Alonso df282a0c94 Fixing register test 2015-01-13 11:24:37 +01:00
Jesús Espino fd0c4faf7b Merge pull request #188 from taigaio/us/1680/email-redesign
Us/1680/email redesign
2015-01-12 18:27:39 +01:00
Jesús Espino 042d2871d6 Add test_emails script to send all emails to test it 2015-01-12 18:07:01 +01:00
Xavier Julián 4fe73aef52 US #1680: Emails redesign 2015-01-12 18:04:41 +01:00
David Barragán Merino e2d071f61c Update CHANGELOG 2015-01-12 17:01:18 +01:00
David Barragán Merino 0a0e46e5a5 Merge pull request #200 from taigaio/improving-api-performance
Some extra api optimizations
2015-01-12 16:41:25 +01:00
Alejandro Alonso ca09cda87c Some extra api optimizations 2015-01-12 16:40:53 +01:00
David Barragán Merino 99691372a5 Update README.md 2015-01-12 16:38:48 +01:00
Xavier Julián a42980282d Email images 2015-01-09 12:50:54 +01:00
Alejandro 65f7014f39 Merge pull request #211 from taigaio/bug/1849/wikilinks-problem
Bug #1849: Fix problem with especial caracter in wikilinks titles
2015-01-08 13:08:30 +01:00
Jesús Espino 42e891e5bc Bug #1849: Fix problem with especial caracter in wikilinks titles 2015-01-08 12:23:56 +01:00
Jesús Espino 09ccf78d7f Merge pull request #210 from taigaio/adding-closed-milestones-counter-to-project-in-api
Adding closed milestones counter to projects API
2015-01-08 11:58:39 +01:00
Alejandro Alonso a4ddac510c Adding closed milestones counter to projects API 2015-01-08 11:55:00 +01:00
Alejandro Alonso f15713f241 [backport] Fixing problem whith parens in links 2015-01-07 15:35:20 +01:00
Jesús Espino 866f213b7f Merge pull request #208 from taigaio/improve-markdown-rendering
Fixing problem whith parens in links
2015-01-07 15:29:55 +01:00
Alejandro Alonso 3afcb0e6b6 Fixing problem whith parens in links 2015-01-07 15:18:56 +01:00
Jesús Espino fa60e2c5e8 Merge pull request #205 from taigaio/archived-userstory-status
Moving archived status from userstory to status
2015-01-02 09:47:22 +00:00
Alejandro Alonso aee57d6110 Moving archived status from userstory to status 2015-01-02 10:44:45 +01:00
Jesús Espino d07be44e40 Merge pull request #202 from taigaio/archived-milestones
Filtering milestones by closed attribute
2015-01-02 09:11:49 +00:00
Jesús Espino 641505b052 [backport] Add h4, h5 and h6 to mdrender allowed tags 2014-12-29 16:15:55 +01:00
Jesús Espino e03672d7e0 Add h4, h5 and h6 to mdrender allowed tags 2014-12-29 16:13:56 +01:00
Alejandro Alonso 731aba0976 Filtering milestones by closed attribute 2014-12-29 13:02:17 +01:00
Jesús Espino b5d84408fc Merge pull request #187 from taigaio/bug/1768/tags-with-special-chars
Splitting tags if containing ,
2014-12-26 11:50:52 +00:00
Jesús Espino 4a1647c111 Merge pull request #197 from e1th0r/master
Modifications to django.po file for to include new spanish translations
2014-12-26 11:25:05 +00:00
Alejandro Alonso d985e93be0 Splitting tags if containing , 2014-12-23 17:34:34 +01:00
Alejandro Alonso e1183deaa6 [backport] Adding end points for getting projects by slug, tasks, userstories and issues by ref 2014-12-23 15:24:32 +01:00
Jesús Espino e8cc305fb7 Merge pull request #199 from taigaio/requests-reduction-refactor
Adding end points for getting projects by slug, tasks, userstories and issues by ref
2014-12-23 14:15:10 +00:00
Alejandro Alonso bb40c528d7 Adding end points for getting projects by slug, tasks, userstories and issues by ref 2014-12-23 12:30:51 +01:00
Alejandro 88a1cd33b2 Update README.md 2014-12-22 09:59:49 +01:00
David Barragán Merino 1d93174198 Merge pull request #198 from taigaio/fix-travis
Try to fix travis tests
2014-12-20 11:46:06 +01:00
David Barragán Merino 6d80927d96 Try to fix tests 2014-12-20 11:06:24 +01:00
David Barragán Merino 749204087b Merge pull request #191 from taigaio/bug/1743/historic-deleted-users-appears-in-listings
Adding user_active info to membership serializer
2014-12-20 10:58:22 +01:00
Hector Colina - e1th0r 75e42efda2 Modifications to django.po file for to include new translations and fixed some gramatical errors 2014-12-19 19:52:23 -04:30
Alejandro Alonso 78e703ad53 Adding user_active info to membership serializer 2014-12-11 10:07:45 +01:00
David Barragán Merino 0d70eb088a [backport] tg-1783 #ready-for-test - Fix wiki links compatibility 2014-12-10 21:28:20 +01:00
David Barragán Merino 9982d2a73b [backport] Remove unnecesary code 2014-12-10 21:27:40 +01:00
Alejandro 380f022f97 Merge pull request #190 from taigaio/bug/1783/fix-internal-wiki-urls
Bug/1783/fix internal wiki urls
2014-12-10 21:19:37 +01:00
David Barragán Merino ce88a60073 tg-1783 #ready-for-test - Fix wiki links compatibility 2014-12-10 21:02:43 +01:00
David Barragán Merino f37de85961 Remove unnecesary code 2014-12-10 20:39:12 +01:00
Alejandro Alonso e44fd21fc7 Adding migration for fixing slugs in ProjectTemplates 2014-12-10 11:16:15 +01:00
Alejandro Alonso a7ed9107c3 Adding migration for fixing slugs in ProjectTemplates 2014-12-10 11:16:00 +01:00
Alejandro Alonso 7abeb74eee Fixing merge 2014-12-10 09:19:41 +01:00
Alejandro Alonso 5e590229c1 Updating changelog 2014-12-10 08:44:31 +01:00
Alejandro 4a911f309a Merge pull request #186 from taigaio/improving-occ-for-not-bothering-when-not-necesary
Improving OCC for detecting situations where the version is not valid bu...
2014-12-10 07:52:52 +01:00
David Barragán Merino ff41370394 Update CHANGELOG 2014-12-04 16:15:31 +01:00
Alejandro Alonso 5a87aa0ed7 Improving OCC for detecting situations where the version is not valid but the changes doesn't overwrite previous ones 2014-12-03 14:47:32 +01:00
Alejandro 354134e157 Merge pull request #184 from taigaio/us/1009/pgarray-query-refactoring
Refactor of tags queries using djorm-pgarray queries
2014-12-03 12:06:17 +01:00
Jesús Espino 6d948b60c0 Merge pull request #185 from taigaio/bug/1736/get_object_or_404_return_500
tg-1736 #closed -> 404 instead 500 when call api/v1/projects/slug instead api/v1/project/id
2014-12-03 11:57:36 +01:00
David Barragán Merino 15ced7c44f tg-1736 #closed -> 404 instead 500 when call api/v1/projects/slug instead api/v1/project/id 2014-12-03 11:57:20 +01:00
Jesús Espino af1450ccf1 Refactor of tags queries using djorm-pgarray queries 2014-12-03 11:53:23 +01:00
Jesús Espino 911eacd664 Merge pull request #179 from taigaio/bug/1709/error-on-concurrent-edition
Detecting concurrent edition and failing properly if needed
2014-12-03 10:21:50 +01:00
Alejandro Alonso 53871e5a8a Detecting concurrent edition and failing properly if needed 2014-12-03 10:21:31 +01:00
David Barragán Merino 29df487bca Fix tests 2014-12-03 00:38:06 +01:00
David Barragán Merino b9f4f3d8ed Merge pull request #182 from taigaio/bug/1714/ordering-tasks
Add bulk update order in user story and taskboard for tasks
2014-12-02 19:21:42 +01:00
David Barragán Merino dde7bf12b9 Don't show order changes in emails 2014-12-02 19:20:36 +01:00
Jesús Espino d9f48b0753 No notify hidden (ordering) changes 2014-12-02 19:20:36 +01:00
Jesús Espino 1101c5a719 Add bulk update order in user story and taskboard for tasks 2014-12-02 19:20:36 +01:00
David Barragán Merino ad34a06481 Merge pull request #175 from taigaio/us/1637/gitlab
Gitlab integration
2014-12-02 16:26:07 +01:00
Jesús Espino 2bbfa56deb Add tests for ip filtering on gitlab/bitbucket hooks 2014-12-02 14:42:43 +01:00
Jesús Espino 151875856e Only apply ip filtering when valid ips list are configured in gitlab and bitbucket hooks 2014-12-02 14:42:43 +01:00
Jesús Espino edcb186871 Fix some tests 2014-12-02 14:42:43 +01:00
Jesús Espino 02400be2a1 Adding ips validation 2014-12-02 14:42:43 +01:00
Jesús Espino bb8a2d2528 Added the key to the webhook url setting 2014-12-02 14:42:42 +01:00
Jesús Espino 268bc70a1e Refactored the create function 2014-12-02 14:42:42 +01:00
Alejandro Alonso 3e46b439bf Bitbucket webhooks for commits 2014-12-02 14:42:42 +01:00
Jesús Espino d974befd6c Gitlab integration 2014-12-02 14:42:42 +01:00
David Barragán Merino 50ad5046e6 Merge pull request #183 from taigaio/bug/1647/delete-comments-by-project-owner
Fixing bug when deleting comments by project owners
2014-12-02 13:15:28 +01:00
Alejandro Alonso 55ac4ce664 Fixing bug when deleting comments by project owners 2014-12-02 13:00:26 +01:00
David Barragán Merino 04a8239a6c Added sane_lists extension to the markdown renderer 2014-12-02 12:46:16 +01:00
Alejandro Alonso aa75763a3d Fixing neighbor tests 2014-12-02 09:36:58 +01:00
Alejandro Alonso 1f9627f18d [Backport] Fixing anonymous user requests for notify policies 2014-12-01 15:59:52 +01:00
Jesús Espino e9045eb14c Merge pull request #180 from taigaio/bug/1720/notify-policies-anonymous-user-error
Fixing anonymous user requests for notify policies
2014-12-01 13:16:14 +01:00
Alejandro Alonso d9c6e3bcf1 Fixing anonymous user requests for notify policies 2014-12-01 14:01:37 +01:00
Jesús Espino d2de4eb12e Added team-members changelog 2014-12-01 13:08:41 +01:00
Jesús Espino 0a0d8724cd Replacing test import of mock, using unittest.mock 2014-12-01 12:42:43 +01:00
Jesús Espino 929ab47249 Merge pull request #178 from taigaio/bug/1668/fix-wiki-links-in-markdown-2
Bug tg-1668 #closed - Convert relative links to absolute links
2014-12-01 10:32:23 +01:00
David Barragán Merino e1f95ec391 Add copyright policy 2014-11-30 11:27:16 +01:00
David Barragán Merino 8b63dc8fa3 Bug tg-1668 #closed - Convert relative links to absolute links 2014-11-29 19:19:39 +01:00
David Barragán Merino 0798b5856b Add copyright policy 2014-11-29 17:41:48 +01:00
Jesús Espino ecee7c6ed3 Merge pull request #174 from taigaio/us/1313/throttling
US #1313: Setup throttling policy
2014-11-28 15:24:36 +01:00
David Barragán Merino 53266a512f US #1313: Setup throttling policy 2014-11-28 10:21:09 +01:00
David Barragán Merino af262e1410 Add next version section on changelog. 2014-11-27 13:39:26 +01:00
David Barragán Merino 63e9594bb3 @ikame 2014-11-27 10:51:12 +01:00
Jesús Espino 5130b32b0f Merge pull request #170 from taigaio/bug/1668/fix-wiki-links-in-markdown
Fix wikilink extension: use absolute urls
2014-11-27 10:03:31 +01:00
Jesús Espino 88568e0268 Merge pull request #172 from taigaio/bug/1700/delete-empty-memberships
If two pending memberships exist in the same projecto I can't delete them
2014-11-27 09:55:40 +01:00
Alejandro 92bce3d4c2 Merge pull request #173 from taigaio/fix/notifications
Fix notification of objects without permissions
2014-11-27 09:46:02 +01:00
Jesús Espino 494f18300a Fix notification of objects without permissions 2014-11-27 09:35:20 +01:00
David Barragán Merino b1fe9b335e Remove unneeded code 2014-11-26 18:51:28 +01:00
Xaviju 1ecb1b40a3 Update CONTRIBUTING.md 2014-11-26 16:36:50 +01:00
eaposner 300856b951 Update README.md 2014-11-26 12:47:59 +01:00
eaposner 88f53b0890 Update README.md 2014-11-26 12:46:14 +01:00
Alejandro Alonso 00c8d33d0d If two pending memberships exist in the same projecto I can't delete them 2014-11-26 11:36:16 +01:00
David Barragán Merino 30ca702323 Fix wikilink extension: use absolute urls 2014-11-26 09:35:28 +01:00
Jesús Espino 72730fdb73 Fixed failing tests 2014-11-25 18:51:58 +01:00
Jesús Espino 63cd1dcac6 Refactoring the filtering by permissions with django-1.7 djorm-pgarray features 2014-11-25 18:51:58 +01:00
Alejandro Alonso c285857844 Refactoring owner permissions, now only is_owner memberships are considered as owner users 2014-11-25 18:51:58 +01:00
Jesús Espino 561dc54b4d Add db_index to key field in history_entry 2014-11-25 18:51:58 +01:00
Alejandro Alonso c9fc2268d0 Adding leave project API 2014-11-25 18:51:57 +01:00
Alejandro Alonso e7b963a674 Adding member stats to the API 2014-11-25 18:51:57 +01:00
David Barragán Merino fa1e0c6bf6 Fix some tests 2014-11-25 18:43:40 +01:00
David Barragán Merino 105a0c650e Remove alt attr in a link 2014-11-25 17:22:24 +01:00
Jesús Espino ddb0f4db18 Merge pull request #165 from taigaio/adding-history-entries-to-sample-data-command
Adding history entries to sample data
2014-11-20 09:19:12 +01:00
Alejandro Alonso bc68f9a092 Adding history entries to sample data 2014-11-20 07:48:02 +01:00
Alejandro Alonso f673482e87 [Backport] Fixing validation of email and role in memberships 2014-11-19 23:39:07 +01:00
David Barragán Merino 9b8f4cfb48 Merge pull request #164 from taigaio/bug/1650/error-validating-email-and-role-in-memberships
Fixing validation of email and role in memberships
2014-11-19 23:36:33 +01:00
Alejandro Alonso e2f0262918 Fixing validation of email and role in memberships 2014-11-19 22:53:37 +01:00
Jesús Espino bf4b813286 Fixed project_templates json fixture to include the slug 2014-11-19 17:30:49 +01:00
Jesús Espino a16fdca0ad Adding partial_update_perms to project api permissions 2014-11-19 15:04:22 +01:00
Jesús Espino b9394e9f49 Small updates of the project templates api 2014-11-19 15:04:22 +01:00
Alejandro Alonso b89be4d089 [Backport] Disabling membership creation if the role isn't valid for the project 2014-11-19 14:29:28 +01:00
David Barragán Merino 145d959dae Merge pull request #163 from taigaio/bug/1628/creating-memberships-with-invalid-role
Disabling membership creation if the role isn't valid for the project
2014-11-19 14:28:22 +01:00
Alejandro Alonso d246808b54 Disabling membership creation if the role isn't valid for the project 2014-11-19 14:28:00 +01:00
Alejandro Alonso ffeff45640 [Backport] Fixing update_roles when project point ? exists but is not null 2014-11-19 14:25:49 +01:00
David Barragán Merino 3d6863d6c1 Merge pull request #162 from taigaio/bug/1634/update-role-failing
Fixing update_roles when project point "?" exists but is not null
2014-11-19 14:24:48 +01:00
Alejandro Alonso 3d96ce81bb Fixing update_roles when project point ? exists but is not null 2014-11-19 14:05:49 +01:00
Alejandro Alonso fc680d85f2 [Backport] Fixing error 500 when using duplicated names for project points 2014-11-19 14:02:56 +01:00
David Barragán Merino edea9ff28b Merge pull request #161 from taigaio/bug/points/error-when-using-duplicated-names-for-project
Fixing error 500 when using duplicated names for project points
2014-11-19 14:01:08 +01:00
Alejandro Alonso 4996ae3a24 Fixing error 500 when using duplicated names for project points 2014-11-19 14:00:37 +01:00
Alejandro Alonso 57777fc54c Merge branch 'master' into stable 2014-11-18 16:05:25 +01:00
Alejandro Alonso f11cb3edaa Updating changelog 2014-11-18 16:04:07 +01:00
Jesús Espino 70c1195d31 Merge pull request #159 from taigaio/redo/github-login
Re-do github login
2014-11-18 15:47:05 +01:00
David Barragán Merino 99244b8393 Re-do github login 2014-11-18 15:35:42 +01:00
Alejandro ccd9bcc4a7 Merge pull request #158 from taigaio/issue/1630/thead-tbody-on-markdown
Added thead and tbody to allowed tags on mdrender service
2014-11-18 14:00:16 +01:00
Jesús Espino 80445d7afd Merge pull request #156 from taigaio/bug/1552/us-points-undefined-when-tasks-points-are-undefined
User story points are undefined if the task points are undefined
2014-11-18 13:48:37 +01:00
Alejandro ac1b43bdb5 Merge pull request #157 from taigaio/external-references-change
Changed how external reference is obtained
2014-11-18 13:47:59 +01:00
Jesús Espino 7b498924e7 Add tests to bug #1553 resolution 2014-11-18 13:32:32 +01:00
Jesús Espino 18e38792b5 Changed how external reference is obtained 2014-11-18 13:03:38 +01:00
Jesús Espino adb2e24423 Added thead and tbody to allowed tags on mdrender service 2014-11-18 12:52:53 +01:00
Alejandro Alonso 058195d670 User story points are undefined if the task points are undefined 2014-11-18 10:16:18 +01:00
David Barragán Merino 5129c1f1e1 @Xaviju wins 🏆: Convert new lines in br tags 2014-11-17 19:12:52 +01:00
Alejandro Alonso e8ae33a3a7 [backport] Fix limit case for non existant neighbors 2014-11-17 13:53:44 +01:00
Alejandro Alonso c34ec5b50c Fix limit case for non existant neighbors 2014-11-17 13:52:52 +01:00
David Barragán Merino c844e59540 Add copyright terms in some files 2014-11-16 12:52:37 +01:00
Alejandro Alonso 6513b866ac Fixing neighbors hell 2014-11-15 22:42:27 +01:00
David Barragán Merino 9d1f2f2bb6 Merge pull request #153 from taigaio/bug/1609/issues-neightbors
Fixing neighbors hell
2014-11-15 22:40:42 +01:00
Alejandro Alonso f49d143c22 Fixing neighbors hell 2014-11-15 22:39:42 +01:00
David Barragán Merino 4db9155769 Merge branch 'master' into stable 2014-11-13 11:56:15 +01:00
David Barragán Merino 8e878810bd Remove spaces at the end of lines 2014-11-13 11:50:34 +01:00
David Barragán Merino 8a3b13bfd8 Update CHANGELOG.md 2014-11-13 11:46:03 +01:00
David Barragán Merino c24bb49788 Update CHANGELOG.md 2014-11-13 11:37:06 +01:00
David Barragán Merino 426604154b Add copyright terms 2014-11-12 21:18:23 +01:00
David Barragán Merino 4432933d7f Merge pull request #149 from taigaio/us/90/github-integration
US#90 Github webhooks integration
2014-11-11 19:34:33 +01:00
David Barragán Merino 36519e94c9 Fix some tests 2014-11-11 19:33:22 +01:00
David Barragán Merino 25bcb855c1 Minor fixes 2014-11-11 19:18:18 +01:00
Jesús Espino 1822198549 Fixed test on Github link 2014-11-11 19:18:18 +01:00
Jesús Espino e77c145d59 Fixed problem with github references link 2014-11-11 19:18:18 +01:00
Jesús Espino cc4f64c115 Fixed travis errors 2014-11-11 19:18:18 +01:00
Jesús Espino 93ea968fb6 Removed the admin pk in the initial_user.json fixture 2014-11-11 19:18:18 +01:00
Jesús Espino aa3a8c6be8 Adding regular expresion to convert github references to links to github 2014-11-11 19:18:18 +01:00
Alejandro Alonso 571bf5e0cc Fixing slug generation for issue status, task status and user story status 2014-11-11 19:18:18 +01:00
Alejandro Alonso 5718627daa Using 400 errors insted of 401 2014-11-11 19:18:18 +01:00
Alejandro Alonso 05bf0cab45 Adding name validation to task status serializer and issue status serializer 2014-11-11 19:18:18 +01:00
Alejandro Alonso 2e78d51eda Fixing bug when changing us's to a non existing status 2014-11-11 19:18:18 +01:00
Alejandro Alonso 2d90a5dac9 Making commit message actions case insensitive 2014-11-11 19:18:18 +01:00
Alejandro Alonso 63cf345ff0 Renaming function get_config_or_default to get_or_generate_config 2014-11-11 19:18:18 +01:00
Alejandro Alonso 88d11aba85 Adding API support for project modules configurations 2014-11-11 19:18:18 +01:00
Alejandro Alonso 0fd7142802 US#90 Github webhooks integration 2014-11-11 19:18:18 +01:00
David Barragán Merino 48dafad8f4 [Backport] Prevent some ObjectDoesNotExist exceptions 2014-11-11 16:11:00 +01:00
David Barragán Merino 6d792a0e91 Prevent some ObjectDoesNotExist exceptions 2014-11-11 15:46:18 +01:00
David Barragán Merino 61141c321e Fix connectors_github tests 2014-11-06 19:36:34 +01:00
David Barragán Merino c20c50f7be Minor fixes to detect invalid configuration to enable github login service 2014-11-05 13:17:05 +01:00
Alejandro 257ed89b04 Merge pull request #150 from taigaio/issue/1532/markdown-problems
Adding br an ins to the whitelist of the bleach tags
2014-11-05 11:43:32 +01:00
Jesús Espino 22a8e391df Adding br an ins to the whitelist of the bleach tags 2014-11-05 11:20:40 +01:00
David Barragán Merino e695abf953 Update changelog 2014-11-04 10:37:58 +01:00
David Barragán Merino 5d5d57ac8c Merge pull request #148 from taigaio/issue/1500/wiki-html-escape
Fix issue #1500: Now generated html is escaped
2014-10-31 13:47:19 +01:00
Jesús Espino c83ffa8529 Fix issue #1500: Now generated html is escaped 2014-10-31 13:10:34 +01:00
Alejandro Alonso f22da3d5aa Fixing typo in generating US 2014-10-31 09:15:17 +01:00
Alejandro 0c93510968 Merge pull request #147 from taigaio/improvements-migrations
Migrations improvements
2014-10-31 08:46:28 +01:00
Andrey Antukh aa780dc205 Add missing parameters (seems bug on django 1.7.x) 2014-10-31 00:23:30 +01:00
Andrey Antukh d62ec0008b Make 0006 migration of project more efficient. 2014-10-30 23:36:06 +01:00
Andrey Antukh da6feaf26e Revert "Update django version to 1.7.1"
This reverts commit fab678987a.
2014-10-30 23:27:28 +01:00
Alejandro 5ac3bf15ab Merge pull request #143 from taigaio/refactor/remove-projects-tags-call
Remove api/v1/projects/XX/tags call (Not necessary)
2014-10-30 18:09:48 +01:00
David Barragán Merino cd890330ed Merge pull request #145 from taigaio/bug/1484/problem-uploading-twice-the-same-files
Fixing problem with new notifications system on upload 2 equal attachments
2014-10-30 11:07:03 +01:00
Alejandro Alonso 147d199c3d Fixing problem with new notifications system on upload 2 equal attachments. 2014-10-30 11:06:39 +01:00
David Barragán Merino 09138ee4ff Merge pull request #146 from taigaio/bug/1466/projects-with-null-total-milestones
Total milestones must never be null
2014-10-30 09:47:14 +01:00
Alejandro Alonso 9016e48ff6 Total milestones must never be null 2014-10-30 09:46:52 +01:00
David Barragán Merino a2203d0bf8 Merge pull request #142 from taigaio/bug/1438/error-when-import-export-finish-date-for-issues-and-user-stories
Fixing error when importing issues, the finished date was set to none by signals. Added some tests
2014-10-29 13:28:11 +01:00
Alejandro Alonso 126e02ce39 Fixing error when importing issues, the finished date was set to none by signals. Added some tests 2014-10-29 13:27:49 +01:00
Jesús Espino dc90036e55 Merge pull request #144 from taigaio/notification-refactor
Notification refactor
2014-10-29 12:41:39 +01:00
Alejandro Alonso cad5a88081 Updating changelog 2014-10-29 11:14:27 +01:00
Alejandro Alonso d36e7e7eaa Fixing invitation tests 2014-10-29 11:11:19 +01:00
Alejandro Alonso 94a4708df7 Using iterqueryset in management command 2014-10-29 09:12:04 +01:00
Alejandro Alonso 50ceecb115 Fixing issue change body email notification template 2014-10-29 08:49:29 +01:00
Alejandro Alonso fac330246b Removing unnecesary print 2014-10-28 22:07:17 +01:00
Alejandro Alonso 08b8d478e1 Making notifications work synchronously by default 2014-10-28 18:26:30 +01:00
Alejandro Alonso 864734c97e Adding managemente command for sending pending notifications 2014-10-28 18:08:50 +01:00
Alejandro Alonso 38fc63425a Fixing tests 2014-10-28 18:08:50 +01:00
Alejandro Alonso 6e313abfbd Adding migrations 2014-10-28 18:08:50 +01:00
Alejandro Alonso 89b8dfdc63 Refactoring email templates for notifications 2014-10-28 18:08:42 +01:00
Alejandro Alonso a68785a380 Refactoring modify notifications 2014-10-28 18:08:42 +01:00
Alejandro Alonso 6b33c30616 Fixing notifications __init__ because it was generating migration problems 2014-10-28 18:08:42 +01:00
David Barragán Merino 77d03c000f Remove api/v1/projects/XX/tags call (Not necessary) 2014-10-27 18:11:17 +01:00
David Barragán Merino 9a885eae6a Merge pull request #141 from taigaio/django-version-update-bugfixes
Update django version to 1.7.1
2014-10-27 00:09:12 +01:00
Andrey Antukh fab678987a Update django version to 1.7.1 2014-10-26 19:23:02 +01:00
Jesús Espino 745d48f218 Merge pull request #140 from entrepreneurj/models/choices/cleanup
Removes redundant FIXME
2014-10-25 09:59:09 +02:00
Joe a726449eb1 Removes redundant FIXME
* Removes a Choice that has already been moved to the .choices module
2014-10-25 06:49:42 +00:00
Alejandro 6f590ff0c7 Merge pull request #138 from taigaio/watchers-validation-bug
Add proper validation of watchers for issues, tasks and userstories serializers.
2014-10-24 09:11:15 +02:00
Alejandro Alonso a1d6875d88 Fixing task tests 2014-10-24 08:47:58 +02:00
David Barragán Merino 037c48608c Merge pull request #139 from taigaio/contributing
Add CONTRIBUTING.md file.
2014-10-24 01:19:33 +02:00
Andrey Antukh 80df378ba1 Add CONTRIBUTING.md file. 2014-10-23 20:53:08 +02:00
Andrey Antukh bc95282cfd Add proper validation of watchers for issues, tasks and userstories serializers. 2014-10-23 20:45:11 +02:00
David Barragán Merino aee501bc2d Merge pull request #136 from taigaio/us/1396/extra-text-for-inviting-users
Adding support for extra text in invitation
2014-10-22 12:54:07 +02:00
Alejandro Alonso 8593b82f8b Adding support for extra text in invitation 2014-10-22 12:53:22 +02:00
David Barragán Merino 06d4ef0188 Merge pull request #135 from taigaio/us/1380/sentry
Adding raven requirement
2014-10-22 12:48:49 +02:00
Alejandro Alonso 50afed05f9 Adding raven requirement 2014-10-22 12:48:28 +02:00
David Barragán Merino d16f0c2193 Fix some errors in sample_data command 2014-10-21 13:53:13 +02:00
Jesús Espino bd519b3d64 Merge branch 'master' into stable
Conflicts:
	tests/integration/test_userstories.py
2014-10-20 13:43:44 +02:00
Jesús Espino ca1b820b12 Update changelog 2014-10-20 13:42:56 +02:00
David Barragán Merino 1dde7615f5 Merge pull request #132 from taigaio/bug/1392/get-neighbors-for-empty-queryset
Fixing bug when selecting neighbors in an empty queryset of related elements
2014-10-20 12:35:46 +02:00
Alejandro Alonso a5c922be9e Fixing bug when selecting neighbors in an empty queryset of related elements 2014-10-20 12:33:24 +02:00
David Barragán Merino 184f97dde1 Merge pull request #134 from taigaio/bug/1393/failing-token-for-logged-users
Fixing error when recovering the user token and the key doesn't exist
2014-10-20 12:28:01 +02:00
Alejandro Alonso 2cc65a17cb Fixing error when recovering the user token and the key doesn't exist 2014-10-20 09:40:51 +02:00
David Barragán Merino 8614a49d0d Merge branch 'bug/967/error-500-when-creating-milestones'. 365 days
committing   👏 👏 👯 👯 ✌️
2014-10-20 00:51:51 +02:00
Alejandro Alonso 991e5a7f42 Fixing error 500 when importing two milestones with the same name 2014-10-20 00:50:39 +02:00
David Barragán Merino 42ec2dd09a Merge pull request #128 from taigaio/bug/979/create-task-consistency
When creating a task with milestone and user_story associated checking t...
2014-10-19 20:10:03 +02:00
Alejandro Alonso 6fc97cf99d When creating a task with milestone and user_story associated checking the user_story is also associated to the milestone 2014-10-19 20:00:17 +02:00
Jesús Espino d6e987f18e fixed problem on taiga wiki page import 2014-10-17 13:01:07 +02:00
Jesús Espino 35143a59e3 Auto slugify the wiki page slug input in the importer 2014-10-17 10:01:20 +02:00
Juanfran 742598a4f8 Merge pull request #127 from taigaio/bug/1188/issues-text-search
Fixing searchs, using an and for the words we search instead of an or
2014-10-16 13:34:11 +02:00
Alejandro Alonso e71a9a1202 Fixing searchs, using an and for the words we search instead of an or 2014-10-16 13:14:43 +02:00
Andrey Antukh b85eb8914c [backport] Auto coerce bytes to string on own json module.a
Only for tests.
2014-10-16 09:25:38 +02:00
Andrey Antukh ae5ca20a76 [backport] Fix incorrect handling of userstory rolepoints update process.
The current implementation allows duplicate points values in one project,
and because of it, unexpected MultipleObjectsReturned can be raised with
previous update_role_points code. The new one fixes this.

Additionally, in some circumstances, the project does not have any points
with None as value, that causes also unexpected errors. The new
implementation fixes it creating a points instance with None as value
if it not exists.

Conflicts:
	tests/integration/test_userstories.py
2014-10-16 09:12:45 +02:00
David Barragán Merino 782805a98f Merge pull request #126 from taigaio/rolepoints-update-fixes
Fix incorrect handling of userstory rolepoints update process.
2014-10-16 00:56:29 +02:00
Andrey Antukh fa05bf8c74 [backport] Add temporal fix to history attachments changes rendering. 2014-10-15 23:54:45 +02:00
Andrey Antukh eb8638fdda [backport] Fix wrong handling role points update.
Additionally it moves the logic from serializer to resource.
2014-10-15 23:54:28 +02:00
Andrey Antukh bcd87114cf [backport] Fix wrong handling moveTo parameter on role destroy. 2014-10-15 23:54:12 +02:00
Andrey Antukh 4056d5214b Fix incorrect handling of userstory rolepoints update process.
The current implementation allows duplicate points values in one project,
and because of it, unexpected MultipleObjectsReturned can be raised with
previous update_role_points code. The new one fixes this.

Additionally, in some circumstances, the project does not have any points
with None as value, that causes also unexpected errors. The new
implementation fixes it creating a points instance with None as value
if it not exists.
2014-10-15 23:45:10 +02:00
David Barragán Merino 154e13cc79 Merge pull request #123 from taigaio/random-fixes
A collection minor fixes + hotfixes
2014-10-15 23:29:01 +02:00
Andrey Antukh 84a7c47210 Rename project tests. 2014-10-15 23:27:54 +02:00
Andrey Antukh 5617de891e Move some userstories test to right location. 2014-10-15 23:27:54 +02:00
Andrey Antukh 3fddbe2054 Add temporal fix to history attachments changes rendering. 2014-10-15 23:27:54 +02:00
Andrey Antukh a3cb48cf8e Fix wrong handling role points update.
Additionally it moves the logic from serializer to resource.
2014-10-15 23:27:54 +02:00
Andrey Antukh 43fd17aaaa Fix wrong handling moveTo parameter on role destroy. 2014-10-15 23:27:54 +02:00
Andrey Antukh 21f1835567 Fix milestone test name. 2014-10-15 19:52:31 +02:00
Andrey Antukh 786599239c Minor tests cleaning. 2014-10-15 19:52:31 +02:00
Andrey Antukh 0f207da0dc Put more clear names to user test functions. 2014-10-15 17:30:22 +02:00
Andrey Antukh 9b6c58bad9 Normalize some tests file names. 2014-10-15 17:29:58 +02:00
Andrey Antukh 480baa3b94 Auto coerce bytes to string on own json module. 2014-10-15 17:29:20 +02:00
David Barragán Merino 7da975d992 Merge pull request #121 from taigaio/cancel-account-signal
Launching cancel_account signal when needed
2014-10-15 13:33:08 +02:00
Alejandro Alonso be8d1719d3 Disabling the posibility of multiple account cancelations for the same cancel_token 2014-10-15 13:16:37 +02:00
Alejandro Alonso 63364f4304 Fixing data sent by cancel account signal 2014-10-15 10:29:08 +02:00
Alejandro Alonso 169c0e364c Launching cancel_account signal when needed 2014-10-15 10:28:41 +02:00
Alejandro Alonso c643fe561f [backport] Increase default backlog order values 2014-10-14 18:03:48 +02:00
David Barragán Merino e94ca914a4 Merge pull request #115 from taigaio/cancel-account-with-token
Cancel account with token
2014-10-14 17:50:45 +02:00
Andrey Antukh 54dda7e62d Merge pull request #122 from taigaio/increase-default-order-values
Increase default backlog order values
2014-10-14 17:48:38 +02:00
Alejandro Alonso e533cadb3f Increase default backlog order values 2014-10-14 17:31:47 +02:00
Andrey Antukh 51f0ef7fef Update gunicorn version on requirements. 2014-10-13 16:59:00 +02:00
Andrey Antukh fb7dfd2bc4 Merge commit 'master' into stable 2014-10-13 10:31:01 +02:00
Andrey Antukh fab6d20338 Add next version section on changelog. 2014-10-13 10:30:14 +02:00
Andrey Antukh a6f78876bc Update changelog and prepare 1.1.0 version. 2014-10-13 10:28:58 +02:00
David Barragán Merino c68b3d693e Fix Bug #1314: Fix problems with attachments and UNICODE characters 2014-10-10 13:55:46 +02:00
Alejandro 60a630a3c5 Merge pull request #112 from taigaio/attachments_import_fix
Fix set size and name on attachments for import api
2014-10-10 09:41:36 +02:00
Alejandro Alonso 4b859bbde9 Removing cancel_token and using django.core.signing stuff 2014-10-10 09:29:51 +02:00
Alejandro 8b07801f60 Merge pull request #116 from taigaio/us/675/convert-issue-to-us
US #675: Define on delete action
2014-10-09 19:16:37 +02:00
David Barragán Merino 50966e7a4f US #675: Define on delete action 2014-10-09 18:58:51 +02:00
Xavier Julián 4404a58b45 Basic email template layout 2014-10-09 09:59:55 +02:00
Jesús Espino 87eda1267b Fix set size and name on attachments for import api 2014-10-08 19:08:46 +02:00
David Barragán Merino 2a9a7676af Merge pull request #111 from taigaio/issue/1183-anonymous-users-api-get-error-500
Fix issue 1183: Now anonymous user can get project and take the correct ...
2014-10-08 14:00:54 +02:00
Jesús Espino 1cf6777799 Fix issue 1183: Now anonymous user can get project and take the correct response 2014-10-08 13:48:52 +02:00
Alejandro Alonso 227add34f0 Sending email on the registry of user 2014-10-08 13:08:54 +02:00
Jesús Espino c7c52b8e97 Merge pull request #110 from taigaio/wrong-usage-of-static-resolution
Remove full_url_static usage.
2014-10-08 13:08:33 +02:00
Andrey Antukh c1dd1dd33b Remove full_url_static usage. 2014-10-08 12:56:43 +02:00
Alejandro Alonso cceef80dbd Adding serializer 2014-10-08 11:27:43 +02:00
Alejandro Alonso 2bfc09b2ee Adding cancel account by token API 2014-10-08 10:33:08 +02:00
Alejandro Alonso a43711be70 Adding cancel_token generation to user on creation 2014-10-08 09:18:34 +02:00
Alejandro 81e8c24da8 Merge pull request #109 from taigaio/bug/1247/attachment-url-in-emails
Bug #1247: Add a link to attachment (added or modified) in emails
2014-10-08 07:58:06 +02:00
David Barragán Merino 8ffce26fb8 Fix requirements.txt 2014-10-08 01:48:15 +02:00
Alejandro Alonso ceff57e84d Sending a custom signal when users are registered 2014-10-08 01:46:31 +02:00
Andrey Antukh d5800ffe3a Update CHANGELOG.md 2014-10-08 00:52:47 +02:00
Andrey Antukh 014b8dc002 Update CHANGELOG.md 2014-10-08 00:52:17 +02:00
David Barragán Merino c205f081cd Bug #1247: Add a link to attachment (added or modified) in emails 2014-10-07 19:05:55 +02:00
Jesús Espino bbc6635812 Removing duplicated enum requirement 2014-10-07 18:17:32 +02:00
Jesús Espino 8a1303f11d Removing duplicated Unidecode 2014-10-07 18:06:53 +02:00
Jesús Espino 785d5c3b09 Fix issue #1249: Wiki link to deleted reference problem 2014-10-07 16:30:23 +02:00
1010 changed files with 186099 additions and 11866 deletions

5
.gitignore vendored
View File

@ -1,13 +1,18 @@
.*.sw* .*.sw*
.#*
*.log *.log
taiga/search taiga/search
settings/local.py settings/local.py
settings/celery_local.py
database.sqlite database.sqlite
logs logs
media media
static
*.pyc *.pyc
*.mo *.mo
.venv .venv
.coverage .coverage
.cache .cache
.\#* .\#*
.project
.env

View File

@ -1,25 +1,25 @@
language: python language: python
python: python:
- "3.4" - "3.5"
services: - "3.6"
- rabbitmq # will start rabbitmq-server
addons: addons:
postgresql: "9.3" postgresql: "9.4"
before_script: services:
- rabbitmq
- postgresql
cache:
- apt
- pip
before_install:
- sudo apt-get -qq update
- sudo /etc/init.d/postgresql stop
- sudo apt-get install -y postgresql-plpython-9.4
- sudo /etc/init.d/postgresql start 9.4
- psql -c 'create database taiga;' -U postgres - psql -c 'create database taiga;' -U postgres
install: install:
- sudo apt-get install postgresql-plpython-9.3 - travis_retry pip install pipenv
- pip install -r requirements-devel.txt --use-mirrors - travis_retry pipenv sync --dev
script: script:
- coverage run --source=taiga --omit='*tests*,*commands*,*migrations*,*admin*,*.jinja,*dashboard*,*settings*,*wsgi*,*questions*,*documents*' -m py.test -v --tb=native - travis_retry pipenv run coverage run --source=taiga --omit='*tests*,*commands*,*migrations*,*admin*,*.jinja,*dashboard*,*settings*,*wsgi*,*questions*,*documents*' -m pytest -v --tb=native
notifications:
email:
recipients:
- jespinog@gmail.com
- andrei.antoukh@gmail.com
- bameda@dbarragan.com
- anler86@gmail.com
on_success: change
on_failure: change
after_success: after_success:
- coveralls - coveralls

9
.tx/config Normal file
View File

@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
lang_map = sr@latin:sr_Latn, zh_CN:zh_Hans, zh_TW:zh_Hant, fa_IR:fa
[taiga-back.taiga]
file_filter = taiga/locale/<lang>/LC_MESSAGES/django.po
source_file = taiga/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO

View File

@ -1,16 +1,38 @@
The PRIMARY AUTHORS are: The PRIMARY AUTHORS are:
- Andrey Antukh <niwi@niwi.be> - Andrey Antukh <niwi@niwi.nz>
- Jesus Espino Garcia <jespinog@gmail.com> - Jesus Espino Garcia <jespinog@gmail.com>
- David Barragán Merino <dbarragan@dbarragan.com> - David Barragán Merino <dbarragan@dbarragan.com>
- Alejandro Alonso <alejandro.alonso@kaleidos.net> - Alejandro Alonso <alejandro.alonso@kaleidos.net>
- Xavi Julian <xavier.julian@kaleidos.net>
- Anler Hernández <hello@anler.me> - Anler Hernández <hello@anler.me>
Special thanks to Kaleidos Open Source S.L. for provice time for taiga Special thanks to Kaleidos Open Source S.L. for provice time for Taiga
development. development.
And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS -- And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
people who have submitted patches, reported bugs, added translations, helped people who have submitted patches, reported bugs, added translations, helped
answer newbie questions, and generally made taiga that much better: answer newbie questions, and generally made taiga that much better:
- ... - Alejandro Gómez <alejandro.gomez@kaleidos.net>
- Allister Antosik <me@allisterantosik.com>
- Alonso Torres <alonso.torres@kaleidos.net>
- Andrea Stagi <stagi.andrea@gmail.com>
- Andrés Moya <andres.moya@kaleidos.net>
- Andrey Alekseenko <al42and@gmail.com>
- Brett Profitt <brett.profitt@gmail.com>
- Bruno Clermont <bruno@robotinfra.com>
- Chris Wilson <chris.wilson@aridhia.com>
- David Burke <david@burkesoftware.com>
- Everardo Medina <everblut@gmail.com>
- Hector Colina <hcolina@gmail.com>
- Joe Letts
- Julien Palard
- luyikei <luyikei.qmltu@gmail.com>
- Michael Jurke <m.jurke@gmx.de>
- Motius GmbH <mail@motius.de>
- Riccardo Coccioli <riccardo.coccioli@immobiliare.it>
- Ricky Posner <e@eposner.com>
- Stefan Auditor <stefan.auditor@erdfisch.de>
- Yamila Moreno <yamila.moreno@kaleidos.net>
- Yaser Alraddadi <yaser@yr.sa>

View File

@ -1,5 +1,505 @@
<a name="1.0.0"></a> # Changelog
# 1.0.0 taiga-back (2014-10-07)
## Unreleased
## 4.1.0 (2019-02-04)
### Misc
- Fix Close sprints
### Features:
- Negative filters
- Activate the Ukrainian language
## 4.0.4 (2019-01-15)
### Misc
- Minor bug fixes.
## 4.0.3 (2018-12-11)
### Misc
- Add extra requirements for oauthlib
## 4.0.2 (2018-12-04)
### Misc
- Update messages catalog.
## 4.0.1 (2018-11-28)
### Misc
- Minor bug fix.
## 4.0.0 Larix cajanderi (2018-11-28)
### Features
- Custom home section (https://tree.taiga.io/project/taiga/issue/3059)
- Custom fields (https://tree.taiga.io/project/taiga/issue/3725):
- Dropdown
- Checkbox
- Number
- Bulk move unfinished objects in sprint (https://tree.taiga.io/project/taiga/issue/5451)
- Paginate history activity
- Improve notifications area (https://tree.taiga.io/project/taiga/issue/2165 and
https://tree.taiga.io/project/taiga/issue/3752)
### Misc
- Minor icon changes
- Lots of small bugfixes
## 3.4.5 (2018-10-15)
### Features
- Prevent local Webhooks
## 3.4.4 (2018-09-19)
### Misc
- Small fixes
## 3.4.3 (2018-09-19)
### Misc
- Refactor attachment url's in timeline
- Avoid receive feedkback in private projects from non-members
- Allow delete reports uuid's
- Small fixes
## 3.4.0 Pinus contorta (2018-08-13)
### Features
- Due dates configuration (https://tree.taiga.io/project/taiga/issue/3070):
- Add due dates to admin attributes
- Update project templates
- Issues to Sprints (https://tree.taiga.io/project/taiga/issue/1181):
- Add milestone filters
## 3.3.14 (2018-08-06)
### Misc
- Improve US reorder algorithm.
- Drop python 3.4 and add python 3.6 to travis configuration.
## 3.3.13 (2018-07-05)
### Misc
- Minor bug fixes.
## 3.3.11 (2018-06-27)
### Features
- Add assigned users kanban/taskboard filter.
- Improve US reorder in kanban.
- Upgrade psycopg2 library.
## 3.3.8 (2018-06-14)
### Misc
- Minor bug fix.
## 3.3.7 (2018-05-31)
### Misc
- Minor bug fix related with project import.
- Pin requirements to solve incompatible versions detected by pip 10.
## 3.3.4 (2018-05-24)
### Misc
- Add features to fulfill GDPR.
## 3.3.3 (2018-05-10)
### Misc
- Update locales.
- Minor bug fixes.
## 3.3.1 (2018-04-30)
### Misc
- Minor bug fixes.
## 3.3.1 (2018-04-30)
### Misc
- Minor bug fixes.
## 3.3.0 Picea mariana (2018-04-26)
### Features
- Add "live notifications" to Taiga:
- Migration for user configuration.
- Add due date to US, tasks and issues (https://tree.taiga.io/project/taiga/issue/3070):
- Add to csv export.
- Add to projects import/export.
- Add to webhooks.
- Add to django admin.
- Add multiple assignement only in US (https://tree.taiga.io/project/taiga/issue/1961):
- The `assigned_to` field is still active.
- Add to csv export.
- Add to projects import/export.
- Add to webhooks.
- Add to django admin.
- Delete cards in Kanban and sprint Taskboard (https://tree.taiga.io/project/taiga/issue/2683).
## 3.2.3 (2018-04-04)
### Misc
- Fix milestone burndown graph with empty US.
- Upgrade markdown library to solve bug.
- Update locales.
## 3.2.2 (2018-03-15)
### Misc
- Minor bug fixes.
## 3.2.0 Betula nana (2018-03-07)
### Features
- Add role filtering in US.
## 3.1.3 (2018-02-28)
### Features
- Increase token entropy.
- Squash field changes on notification emails
- Minor bug fixes.
## 3.1.0 Perovskia Atriplicifolia (2017-03-10)
### Features
- Contact with the project: if the projects have this module enabled Taiga users can contact them.
- Ability to create rich text custom fields in Epics, User Stories, Tasks and Isues.
- Full text search now use simple as tokenizer so search with non-english text are allowed.
- Duplicate project: allows creating a new project based on the structure of another (status, tags, colors, default values...)
- Add thumbnails and preview for PSD files.
- Add thumbnails and preview for SVG files (Cario lib is needed).
- i18n:
- Add japanese (ja) translation.
- Add korean (ko) translation.
- Add chinese simplified (zh-Hans) translation.
- Third party services project importers:
- Trello
- Jira 7
- Github
- Asana
### Misc
- API:
- Memberships API endpoints now allows using usernames and emails instead of using only emails.
- Contacts API allow full text search (by the username, full name or email).
- Filter milestones, user stories and tasks by estimated_start and estimated_finish dates.
- Add project_extra_info to epics, tasks, milestones, issues and wiki pages endpoints.
- Gogs integration: Adding new Gogs signature method.
- Lots of small and not so small bugfixes.
## 3.0.0 Stellaria Borealis (2016-10-02)
### Features
- Add Epics.
- Include created, modified and finished dates for tasks in CSV reports.
- Add gravatar url to Users API endpoint.
- ProjectTemplates now are sorted by the attribute 'order'.
- Create enpty wiki pages (if not exist) when a new link is created.
- Diff messages in history entries now show only the relevant changes (with some context).
- User stories and tasks listing API call support extra params to include more data (tasks and attachemnts and attachments, respectively)
- Comments:
- Now comment owners and project admins can edit existing comments with the history Entry endpoint.
- Add a new permissions to allow add comments instead of use the existent modify permission for this purpose.
- Tags:
- New API endpoints over projects to create, rename, edit, delete and mix tags.
- Tag color assignation is not automatic.
- Select a color (or not) to a tag when add it to stories, issues and tasks.
- Improve search system over stories, tasks and issues:
- Search into tags too. (thanks to [Riccardo Cocciol](https://github.com/volans-))
- Weights are applied: (subject = ref > tags > description).
- Import/Export:
- Gzip export/import support.
- Export performance improvements.
- Add filter by email domain registration and invitation by setting.
- Third party integrations:
- Included gogs as builtin integration.
- Improve messages generated on webhooks input.
- Add mentions support in commit messages.
- Cleanup hooks code.
- Rework webhook signature header to align with larger implementations and defined [standards](https://superfeedr-misc.s3.amazonaws.com/pubsubhubbub-core-0.4.html\#authednotify). (thanks to [Stefan Auditor](https://github.com/sanduhrs))
- Add created-, modified-, finished- and finish_date queryset filters
- Support exact match, gt, gte, lt, lte
- added issues, tasks and userstories accordingly
- i18n:
- Add norwegian Bokmal (nb) translation.
### Misc
- [API] Improve performance of some calls over list.
- Lots of small and not so small bugfixes.
## 2.1.0 Ursus Americanus (2016-05-03)
### Features
- Add sprint name and slug on search results for user stories (thanks to [@everblut](https://github.com/everblut))
- [API] projects resource: Random order if `discover_mode=true` and `is_featured=true`.
- Webhooks: Improve webhook data:
- add permalinks
- owner, assigned_to, status, type, priority, severity, user_story, milestone, project are objects
- add role to 'points' object
- add the owner to every notification ('by' field)
- add the date of the notification ('date' field)
- show human diffs in 'changes'
- remove unnecessary data
- CSV Reports:
- Change field name: 'milestone' to 'sprint'
- Add new fields: 'sprint_estimated_start' and 'sprint_estimated_end'
- Importer:
- Remove project after load a dump file fails
- Add more info the the logger if load a dump file fails
### Misc
- Lots of small and not so small bugfixes.
## 2.0.0 Pulsatilla Patens (2016-04-04)
### Features
- Ability to create url custom fields. (thanks to [@astagi](https://github.com/astagi)).
- Blocked projects support
- Transfer projects ownership support
- Customizable max private and public projects per user
- Customizable max of memberships per owned private and public projects
### Misc
- Lots of small and not so small bugfixes.
## 1.10.0 Dryas Octopetala (2016-01-30)
### Features
- Add logo field to project model
- Add is_featured field to project model
- Add is_looking_for_people and looking_for_people_note fields to project model
- Filter projects list by
- is_looking_for_people
- is_featured
- is_backlog_activated
- is_kanban_activated
- Search projects by text query (order by ranking name > tags > description)
- Order projects list:
- alphabetically by default
- by fans (last week/moth/year/all time)
- by activity (last week/moth/year/all time)
- Show stats for discover secction
- i18n.
- Add swedish (sv) translation.
- Add turkish (tr) translation.
### Misc
- Lots of small and not so small bugfixes.
## 1.9.1 Taiga Tribe (2016-01-05)
### Features
- [CSV Reports] Add fields "created_date", "modified_date", "finished_date" to issues CSV report.
- [Attachment] Generate 'card-image' size (300x200) thumbnails for attached image files.
### Misc
- Improve login and forgot password: allow username or email case-insensitive if the query only
match with one user.
- Improve the django admin panel, now it is more usable and all the selector fields works properly.
- [API] Add tribe_gig field to user stories (improve integration between Taiga and Taiga Tribe).
- [API] Performance improvements for project stats.
- [Events] Add command to send an instant notifications to all the currently online users.
- Lots of small and not so small bugfixes.
## 1.9.0 Abies Siberica (2015-11-02)
### Features
- Project can be starred or unstarred and the fans list can be obtained.
- US, tasks and Issues can be upvoted or downvoted and the voters list can be obtained.
- Now users can watch public issues, tasks and user stories.
- Add endpoints to show the watchers list for issues, tasks and user stories.
- Add a "field type" property for custom fields: 'text', 'multiline text' and 'date' right nowi
(thanks to [@artlepool](https://github.com/artlepool)).
- Allow multiple actions in the commit messages.
- Now every user that coments USs, Issues or Tasks will be involved in it (add author to the watchers list).
- Now profile timelines only show content about the objects (US/Tasks/Issues/Wiki pages) you are involved.
- Add custom videoconference system.
- Fix the compatibility with BitBucket webhooks and add issues and issues comments integration.
- Add support for comments in the Gitlab webhooks integration.
- Add externall apps: now Taiga can integrate with hundreds of applications and service.
- Improve searching system, now full text searchs are supported
- Add sha1 hash to attachments to verify the integrity of files (thanks to [@astagi](https://github.com/astagi)).
- i18n.
- Add italian (it) translation.
- Add polish (pl) translation.
- Add portuguese (Brazil) (pt_BR) translation.
- Add russian (ru) translation.
### Misc
- Made compatible with python 3.5.
- Migrated to django 1.8.
- Update the rest of requirements to the last version.
- Improve export system, now is more efficient and prevents possible crashes with heavy projects.
- API: Mixin fields 'users', 'members' and 'memberships' in ProjectDetailSerializer.
- API: Add stats/system resource with global server stats (total project, total users....)
- API: Improve and fix some errors in issues/filters_data and userstories/filters_data.
- API: resolver suport ref GET param and return a story, task or issue.
- Webhooks: Add deleted datetime to webhooks responses when isues, tasks or USs are deleted.
- Add headers to allow threading for notification emails about changes to issues, tasks, user stories,
and wiki pages. (thanks to [@brett](https://github.com/brettp)).
- Lots of small and not so small bugfixes.
## 1.8.0 Saracenia Purpurea (2015-06-18)
### Features
- Improve timeline resource.
- Add sitemap of taiga-front (the web client).
- Search by reference (thanks to [@artlepool](https://github.com/artlepool))
- Add call 'by_username' to the API resource User
- i18n.
- Add deutsch (de) translation.
- Add nederlands (nl) translation.
### Misc
- Lots of small and not so small bugfixes.
## 1.7.0 Empetrum Nigrum (2015-05-21)
### Features
- Make Taiga translatable (i18n support).
- i18n.
- Add spanish (es) translation.
- Add french (fr) translation.
- Add finish (fi) translation.
- Add catalan (ca) translation.
- Add traditional chinese (zh-Hant) translation.
- Add Jitsi to our supported videoconference apps list
- Add tags field to CSV reports.
- Improve history (and email) comments created by all the GitHub actions
### Misc
- New contrib plugin for letschat (by Δndrea Stagi)
- Remove djangorestframework from requirements. Move useful code to core.
- Lots of small and not so small bugfixes.
## 1.6.0 Abies Bifolia (2015-03-17)
### Features
- Added custom fields per project for user stories, tasks and issues.
- Support of export to CSV user stories, tasks and issues.
- Allow public projects.
### Misc
- New contrib plugin for HipChat (by Δndrea Stagi).
- Lots of small and not so small bugfixes.
- Updated some requirements.
## 1.5.0 Betula Pendula - FOSDEM 2015 (2015-01-29)
### Features
- Improving SQL queries and performance.
- Now you can export and import projects between Taiga instances.
- Email redesign.
- Support for archived status (not shown by default in Kanban).
- Removing files from filesystem when deleting attachments.
- Support for contrib plugins (existing yet: slack, hall and gogs).
- Webhooks added (crazy integrations are welcome).
### Misc
- Lots of small and not so small bugfixes.
## 1.4.0 Abies veitchii (2014-12-10)
### Features
- Bitbucket integration:
+ Change status of user stories, tasks and issues with the commit messages.
- Gitlab integration:
+ Change status of user stories, tasks and issues with the commit messages.
+ Sync issues creation in Taiga from Gitlab.
- Support throttling.
+ for anonymous users
+ for authenticated users
+ in import mode
- Add project members stats endpoint.
- Support of leave project.
- Control of leave a project without admin user.
- Improving OCC (Optimistic concurrency control)
- Improving some SQL queries using djrom directly
### Misc
- Lots of small and not so small bugfixes.
## 1.3.0 Dryas hookeriana (2014-11-18)
### Features
- GitHub integration (Phase I):
+ Login/singin connector.
+ Change status of user stories, tasks and issues with the commit messages.
+ Sync issues creation in Taiga from GitHub.
+ Sync comments in Taiga from GitHub issues.
### Misc
- Lots of small and not so small bugfixes.
## 1.2.0 Picea obovata (2014-11-04)
### Features
- Send an email to the user on signup.
- Emit django signal on user signout.
- Support for custom text when inviting users.
### Misc
- Lots of small and not so small bugfixes.
## 1.1.0 Alnus maximowiczii (2014-10-13)
### Misc
- Fix bugs related to unicode chars on attachments.
- Fix wrong static url resolve usage on emails.
- Fix some bugs on import/export api related with attachments.
## 1.0.0 (2014-10-07)
### Misc ### Misc
- Lots of small and not so small bugfixes - Lots of small and not so small bugfixes

51
CODE_OF_CONDUCT.md Executable file
View File

@ -0,0 +1,51 @@
# Taiga.io Community CoC (Code of Conduct)
### Version 0.1
As contributors and maintainers of any Taiga.io project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this projects a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community (like our
mailing list, Google Groups, in Twitter, Facebook, etc.).
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at
[conduct@taiga.io](mailto:coc@taiga.io). All complaints will be reviewed
and investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. Maintainers are obligated to maintain
confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

122
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,122 @@
# How can I contribute to Taiga?
---
## Developer Certificate of Origin + License
By contributing to Taiga Agile LLC., You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Taiga Agile LLC. Except for the license granted herein to Taiga Agile LLC. and recipients of software distributed by Taiga Agile LLC., You reserve all right, title, and interest in and to Your Contributions.
All Contributions are subject to the following DCO + License terms.
[DCO + License](https://github.com/taiga/taiga-back/blob/master/DCOLICENSE)
_This notice should stay as the first item in the CONTRIBUTING.md file._
---
We will be very happy to help us to improve Taiga, there are many different ways to contribute to Taiga's development, just find the one that best fits with your skills. Here are the guidelines we'd like you to follow.
## Our Code of Conduct
Help us keep the Taiga Community open and inclusive. Please read and follow our [Code of Conduct][CoC].
## Our License
Every code patch accepted in Taiga codebase is licensed under [AGPL v3.0][AGPL v3.0]. You must be careful to not include any code that can not be licensed under this license.
Please read carefully [our license][Taiga license] and ask us if you have any questions.
## Setup problems
If you follow our [setup guide][taiga Dev/Setup documentation] and you have some problem, please tell with us in our [mailing list][Taiga Mailing List].
## Sent us your feedback or questions
If you want to send us your feedback or have some questions about how to use Taiga, please direct these to our [mailing list][Taiga Mailing List]. If it's related to our SaaS https://taiga.io please write us to our support email [support@taiga.io][Support email].
Remember that you can find some help in our [support pages][Taiga User documentation].
## Did you find an issue or bug?
If you find an issue using the app (UX or UI bug) or reading our source code and it's not on our [Bug list][Taiga Bug list] at Taiga.io, please report it:
- in our [mailing list][Taiga Mailing List]
- in the issue section of the appropriate repository at [GitHub][Taiga in GitHub].
- send us a mail to [support@taiga.io][Support email] if is a bug related to [tree.taiga.io][Taiga.io].
- send a mail to [security@taiga.io][Security email] if is a **security bug**.
Even better: you can submit a Pull Request with a fix.
Please, before reporting a bug write down
- explain why this is a bug for you
- how can we reproduce it
- your operating System
- your browser and version
- if it's possible, a screenshot
Sometimes it takes less time to fix a bug if the developer knows how to find it and we will solve your problem as fast as possible.
**Localization Issue:** Taiga use Transifex to manage the i18n files so don't submit a pull request to those files (except `-en.json`), to fix it just access our team of translators, set up an account in the [Taiga Transifex project][Taiga in Transifex] and start contributing.
## Propose some feature or enhancement
You can propose a new enhancement to our [mailing list][Taiga Mailing List] or review and upvote in the existing [list of enhancements][Taiga Enhancement list] in Taiga.io.
If you would like to implement it by yourself consider what kind of change it is:
### Small Changes
It can be crafted and submitted to the [GitHub Repositories][Taiga in GitHub] as a Pull Request.
### Major Changes
Before contributing with a major change to Taiga it should be discussed first with the Taiga Team so that we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. Please, contact us in the [mailing list][Taiga mailing list] or via [support@taiga.io][Support email].
We have defined a concrete workflow for this changes:
1. **User Story**: Send us a complete description of the functionality you'd like to develop, how it should work, for which profiles, as if you were writing a User Story. Please include some ideas of what would be a definition of Done of the User Story. The team will review it, decide whether or not it could make it into Taiga Core. If not, you can always write a plugin.
2. **Mentorship**: If accepted, Taiga team will help you, and a person from the team will be your contact in the development process. The Story will be visible in the [Taiga Kanban][Taiga Kanban]
3. **User Experience**: The functionality will require some wireframes or ideas to be developed correctly. A good UX its an essential part of Taiga success. You should create a user experience proposal and the Taiga UX team will help you.
4. **Design**: The design should respect the Taiga style. Try to reproduce other areas of the site. The taiga design team will review this proposal as well.
5. **Development**: The last step is the development. Remember to add unit and integration test in `taiga-back` code and unit and e2e test for `taiga-back` part. We have the API well documented too in [taiga-doc][Taiga Dev/Setup documentation].
6. **Pull request**: Remember to add a good description and screenshots are welcome too. Once the pull request is done, someone else from the team will review the code to ensure that it fits with the good practices and styles. If it does, the PR will be merged and will be on the next Taiga release.
If you think you are not able to do one or more of the parts of the process, your contribution is still welcome, but we cannot ensure that it will make it soon into the Taiga core anytime soon. It will depend on our priority backlog.
Thanks a lot! It is really great that we could make Taiga better with the help of the community.
### Contrib plugins
Taiga support contrib plugins to add or overwrite some functionalities. You can find some example in [our organization at GitHub][Taiga in GitHub].
## Improve the documentation
We are gathering lots of information from our users to build and enhance our documentation. If you use the documentation to install or develop with Taiga and find any mistakes, omissions or confused sequences, it is enormously helpful to report it. Or better still, if you believe you can author additions, please make a pull-request to taiga project.
Currently, we have authored three main documentation hubs:
- [Taiga Setup/Dev documentation][Taiga Dev/Setup documentation repo]: If you need to install Taiga on your own server, this is the place to find some guides or our API documentation and reference for developing from Taiga API.
- [Taiga User documentation][Taiga User documentation repo]: This page is intended to be the support reference page for the users. If you find any mistake, please report or fix it.
[Taiga.io]: https://taiga.io
[CoC]: https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
[AGPL v3.0]: http://www.gnu.org/licenses/agpl-3.0.html
[Taiga license]: https://github.com/taigaio/taiga-back/blob/master/LICENSE
[Taiga Mailing List]: http://groups.google.co.uk/d/forum/taigaio
[Support email]: mailto:support@taiga.io
[Security email]: mailto:security@taiga.io
[Taiga in Transifex]: https://www.transifex.com/organization/taiga-agile-llc/
[Taiga in GitHub]: https://github.com/taigaio
[Taiga kanban]: https://tree.taiga.io/project/taiga/kanban
[Taiga Bug list]: https://tree.taiga.io/project/taiga/issues?statuses=1,2&orderBy=-created_date&page=1&types=1
[Taiga Enhancement list]: https://tree.taiga.io/project/taiga/issues?statuses=1,2&orderBy=-total_voters&page=1&status=1,2&types=6
[Taiga Dev/Setup documentation]: http://taigaio.github.io/taiga-doc/dist/
[Taiga Dev/Setup documentation repo]: https://github.com/taigaio/taiga-doc
[Taiga User documentation]: https://tree.taiga.io/support/
[Taiga User documentation repo]: https://github.com/taigaio/taiga-support

705
DCOLICENSE Normal file
View File

@ -0,0 +1,705 @@
Developer Certificate of Origin + License
By contributing to Taiga Agile LLC., You accept and agree to the following
terms and conditions for Your present and future Contributions submitted to
Taiga Agile LLC. Except for the license granted herein to Taiga Agile LLC. and
recipients of software distributed by Taiga Agile LLC., You reserve all right,
title, and interest in and to Your Contributions.
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the right
to submit it under the open source license indicated in the file; or
(b) The contribution is based upon previous work that, to the best of my
knowledge, is covered under an appropriate open source license and I have the
right under that license to submit that work with modifications, whether
created in whole or in part by me, under the same open source license
(unless I am permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other person who
certified (a), (b) or (c) and I have not modified it.
(d) I understand and agree that this project and the contribution are public
and that a record of the contribution (including all personal information I
submit with it, including my sign-off) is maintained indefinitely and may be
redistributed consistent with this project or the open source license(s)
involved.
All Contributions to this project are licensed under the following license:
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

19
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,19 @@
**Before adding an issue**
Please ensure that your issue is not already reported in our [issues list](https://tree.taiga.io/project/taiga/issues?order_by=-created_date).
If this issue was already reported, remember that you can upvote it to raise its importance.
**Do you want to request a *feature* or report a *bug*?**
**What is the current behavior?**
**If the current behavior is a bug, please provide the steps to reproduce.**
**What is the expected behavior?**
**Is it happening in taiga.io or in your own instance?**
**What browser/version are you using?**
**Are there any console errors *(Ctrl + F12)* in red?**
Thanks for reporting!

53
Pipfile Normal file
View File

@ -0,0 +1,53 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
asana = "==0.6.7"
bleach = "==2.1.4"
celery = "==4.0.2"
cryptography = "==2.3.1"
diff-match-patch = "==20121119"
django-ipware = "==1.1.6"
django-jinja = "==2.3.1"
django-picklefield = "==0.3.2"
django-pglocks = "==1.0.2"
django-sampledatahelper = "==0.4.1"
django-sites = "==0.9"
django-sr = "==0.0.4"
djmail = "==1.0.1"
easy-thumbnails = "==2.4.1"
fn = "==0.4.3"
gunicorn = "==19.7.1"
kombu = "==4.0.2" # The same as celery
netaddr = "==0.7.19"
premailer = "==3.0.1"
psd-tools = "==1.4"
"psycopg2-binary" = "==2.7.5"
python-dateutil = "==2.7.5"
python-magic = "==0.4.13"
pytz = "*"
raven = "==6.1.0"
redis = "==2.10.5"
requests = "==2.20.0"
requests_oauthlib = "*"
serpy = "==0.1.1"
webcolors = "==1.7"
CairoSVG = "==2.0.3"
Django = "~=1.11.15"
Markdown = "==3.0.1"
Pillow = "==4.1.1"
Unidecode = "==0.4.20"
Pygments = "==2.2.0"
oauthlib = {extras = ["signedtoken"],version = "*"}
[dev-packages]
coverage = "*"
coveralls = "*"
pytest = "*"
pytest-django = "*"
factory-boy = "*"
[requires]
python_version = "3.6"

805
Pipfile.lock generated Normal file
View File

@ -0,0 +1,805 @@
{
"_meta": {
"hash": {
"sha256": "2505838cdc4b5390130990ae63647a4447c5f146ab37ca8bf29f627091112cf7"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"amqp": {
"hashes": [
"sha256:073dd02fdd73041bffc913b767866015147b61f2a9bc104daef172fc1a0066eb",
"sha256:eed41946890cd43e8dee44a316b85cf6fee5a1a34bb4a562b660a358eb529e1b"
],
"version": "==2.3.2"
},
"asana": {
"hashes": [
"sha256:412398ff0f72104f5fb602653b994cdd36de89aedff2d37229b237f300f5f01b",
"sha256:d576601116764050c4cf63b417f1c24700b76cf6686f0e51e6b0b77d450e7973"
],
"index": "pypi",
"version": "==0.6.7"
},
"asn1crypto": {
"hashes": [
"sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87",
"sha256:9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49"
],
"version": "==0.24.0"
},
"billiard": {
"hashes": [
"sha256:42d9a227401ac4fba892918bba0a0c409def5435c4b483267ebfe821afaaba0e"
],
"version": "==3.5.0.5"
},
"bleach": {
"hashes": [
"sha256:0ee95f6167129859c5dce9b1ca291ebdb5d8cd7e382ca0e237dfd0dad63f63d8",
"sha256:24754b9a7d530bf30ce7cbc805bc6cce785660b4a10ff3a43633728438c105ab"
],
"index": "pypi",
"version": "==2.1.4"
},
"cairocffi": {
"hashes": [
"sha256:15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337"
],
"version": "==0.9.0"
},
"cairosvg": {
"hashes": [
"sha256:d2da5aaa31ded26affd5cdffc371ec4cc48800bc2d822a9c28504360482418a1"
],
"index": "pypi",
"version": "==2.0.3"
},
"celery": {
"hashes": [
"sha256:0e5b7e0d7f03aa02061abfd27aa9da05b6740281ca1f5228a54fbf7fe74d8afa",
"sha256:e3d5a6c56a73ff8f2ddd4d06dc37f4c2afe4bb4da7928b884d0725ea865ef54d"
],
"index": "pypi",
"version": "==4.0.2"
},
"certifi": {
"hashes": [
"sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7",
"sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"
],
"version": "==2018.11.29"
},
"cffi": {
"hashes": [
"sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743",
"sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef",
"sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50",
"sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f",
"sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30",
"sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93",
"sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257",
"sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b",
"sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3",
"sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e",
"sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc",
"sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04",
"sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6",
"sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359",
"sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596",
"sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b",
"sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd",
"sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95",
"sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5",
"sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e",
"sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6",
"sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca",
"sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31",
"sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1",
"sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2",
"sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085",
"sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801",
"sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4",
"sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184",
"sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917",
"sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f",
"sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb"
],
"version": "==1.11.5"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"contextlib2": {
"hashes": [
"sha256:509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48",
"sha256:f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00"
],
"version": "==0.5.5"
},
"cryptography": {
"hashes": [
"sha256:02602e1672b62e803e08617ec286041cc453e8d43f093a5f4162095506bc0beb",
"sha256:10b48e848e1edb93c1d3b797c83c72b4c387ab0eb4330aaa26da8049a6cbede0",
"sha256:17db09db9d7c5de130023657be42689d1a5f60502a14f6f745f6f65a6b8195c0",
"sha256:227da3a896df1106b1a69b1e319dce218fa04395e8cc78be7e31ca94c21254bc",
"sha256:2cbaa03ac677db6c821dac3f4cdfd1461a32d0615847eedbb0df54bb7802e1f7",
"sha256:31db8febfc768e4b4bd826750a70c79c99ea423f4697d1dab764eb9f9f849519",
"sha256:4a510d268e55e2e067715d728e4ca6cd26a8e9f1f3d174faf88e6f2cb6b6c395",
"sha256:6a88d9004310a198c474d8a822ee96a6dd6c01efe66facdf17cb692512ae5bc0",
"sha256:76936ec70a9b72eb8c58314c38c55a0336a2b36de0c7ee8fb874a4547cadbd39",
"sha256:7e3b4aecc4040928efa8a7cdaf074e868af32c58ffc9bb77e7bf2c1a16783286",
"sha256:8168bcb08403ef144ff1fb880d416f49e2728101d02aaadfe9645883222c0aa5",
"sha256:8229ceb79a1792823d87779959184a1bf95768e9248c93ae9f97c7a2f60376a1",
"sha256:8a19e9f2fe69f6a44a5c156968d9fc8df56d09798d0c6a34ccc373bb186cee86",
"sha256:8d10113ca826a4c29d5b85b2c4e045ffa8bad74fb525ee0eceb1d38d4c70dfd6",
"sha256:be495b8ec5a939a7605274b6e59fbc35e76f5ad814ae010eb679529671c9e119",
"sha256:dc2d3f3b1548f4d11786616cf0f4415e25b0fbecb8a1d2cd8c07568f13fdde38",
"sha256:e4aecdd9d5a3d06c337894c9a6e2961898d3f64fe54ca920a72234a3de0f9cb3",
"sha256:e79ab4485b99eacb2166f3212218dd858258f374855e1568f728462b0e6ee0d9",
"sha256:f995d3667301e1754c57b04e0bae6f0fa9d710697a9f8d6712e8cca02550910f"
],
"index": "pypi",
"version": "==2.3.1"
},
"cssselect": {
"hashes": [
"sha256:066d8bc5229af09617e24b3ca4d52f1f9092d9e061931f4184cd572885c23204",
"sha256:3b5103e8789da9e936a68d993b70df732d06b8bb9a337a05ed4eb52c17ef7206"
],
"version": "==1.0.3"
},
"cssutils": {
"hashes": [
"sha256:a2fcf06467553038e98fea9cfe36af2bf14063eb147a70958cfcaa8f5786acaf",
"sha256:c74dbe19c92f5052774eadb15136263548dd013250f1ed1027988e7fef125c8d"
],
"version": "==1.0.2"
},
"diff-match-patch": {
"hashes": [
"sha256:9dba5611fbf27893347349fd51cc1911cb403682a7163373adacc565d11e2e4c"
],
"index": "pypi",
"version": "==20121119"
},
"django": {
"hashes": [
"sha256:29268cc47816a44f27308e60f71da635f549c47d8a1d003b28de55141df75791",
"sha256:37f5876c1fbfd66085001f4c06fa0bf96ef05442c53daf8d4294b6f29e7fa6b8"
],
"index": "pypi",
"version": "==1.11.16"
},
"django-ipware": {
"hashes": [
"sha256:93a90f9dd8caf2c633172aa8c8ba4e76e2b44f92a6942fa35e7624281e81ea03"
],
"index": "pypi",
"version": "==1.1.6"
},
"django-jinja": {
"hashes": [
"sha256:5e826a0cce967f40e6fdc037ea23667a2d3cd072807c4c87ffcc010b3c59121f",
"sha256:ebfde44cb716e57a9cdff6c1a4935fc49c7419ea4cd0b2b89bcecc696b9c0c86"
],
"index": "pypi",
"version": "==2.3.1"
},
"django-pglocks": {
"hashes": [
"sha256:9405ee54bbf157bb16b814f20ea7ad9d82d5cf26f9bf3ea8e3a71032179844cf"
],
"index": "pypi",
"version": "==1.0.2"
},
"django-picklefield": {
"hashes": [
"sha256:5489fef164de43725242d56e65e016137d3df0d1a00672bda72d807f5b2b0d99",
"sha256:fab48a427c6310740755b242128f9300283bef159ffee42d3231a274c65d9ae2"
],
"index": "pypi",
"version": "==0.3.2"
},
"django-sampledatahelper": {
"hashes": [
"sha256:96d0a599054979eb9669d44a1735236da42d56be0c45d4bcd34c2a3acefb259d"
],
"index": "pypi",
"version": "==0.4.1"
},
"django-sites": {
"hashes": [
"sha256:fa1470bd72be589f3891b7cd28dd2d782d8b34539665d9334e49154566f3d916"
],
"index": "pypi",
"version": "==0.9"
},
"django-sr": {
"hashes": [
"sha256:3586b852ae8af1b4b2796590534b0b867b523f47a5779b2ccb6ce010efc57e34"
],
"index": "pypi",
"version": "==0.0.4"
},
"djmail": {
"hashes": [
"sha256:370f57230bf79004840ddd1cb8150a5b7676b2aa14bc5b62027106cb708a47a0"
],
"index": "pypi",
"version": "==1.0.1"
},
"docopt": {
"hashes": [
"sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
],
"version": "==0.6.2"
},
"easy-thumbnails": {
"hashes": [
"sha256:5cc51c6ec7de110355d0f8cd56c9ede6e2949e87c2fcb34bc864a20ecd424270",
"sha256:6e41e70a182a6d00af9f3f3a6d1cc87cb7da060a3d56982da51d266e40fc9b59"
],
"index": "pypi",
"version": "==2.4.1"
},
"fn": {
"hashes": [
"sha256:f8cd80cdabf15367a2f07e7a9951fdc013d7200412743d85b88f2c896c95bada"
],
"index": "pypi",
"version": "==0.4.3"
},
"gunicorn": {
"hashes": [
"sha256:75af03c99389535f218cc596c7de74df4763803f7b63eb09d77e92b3956b36c6",
"sha256:eee1169f0ca667be05db3351a0960765620dad53f53434262ff8901b68a1b622"
],
"index": "pypi",
"version": "==19.7.1"
},
"html5lib": {
"hashes": [
"sha256:20b159aa3badc9d5ee8f5c647e5efd02ed2a66ab8d354930bd9ff139fc1dc0a3",
"sha256:66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
],
"version": "==1.0.1"
},
"idna": {
"hashes": [
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
],
"version": "==2.7"
},
"jinja2": {
"hashes": [
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
"sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
],
"version": "==2.10"
},
"kombu": {
"hashes": [
"sha256:385bf38e6de7f3851f674671dbfe24572ce999608d293a85fb8a630654d8bd9c",
"sha256:d0fc6f2a36610a308f838db4b832dad79a681b516ac1d1a1f9d42edb58cc11a2"
],
"index": "pypi",
"version": "==4.0.2"
},
"lxml": {
"hashes": [
"sha256:02bc220d61f46e9b9d5a53c361ef95e9f5e1d27171cd461dddb17677ae2289a5",
"sha256:22f253b542a342755f6cfc047fe4d3a296515cf9b542bc6e261af45a80b8caf6",
"sha256:2f31145c7ff665b330919bfa44aacd3a0211a76ca7e7b441039d2a0b0451e415",
"sha256:36720698c29e7a9626a0dc802ef8885f8f0239bfd1689628ecd459a061f2807f",
"sha256:438a1b0203545521f6616132bfe0f4bca86f8a401364008b30e2b26ec408ce85",
"sha256:4815892904c336bbaf73dafd54f45f69f4021c22b5bad7332176bbf4fb830568",
"sha256:5be031b0f15ad63910d8e5038b489d95a79929513b3634ad4babf77100602588",
"sha256:5c93ae37c3c588e829b037fdfbd64a6e40c901d3f93f7beed6d724c44829a3ad",
"sha256:60842230678674cdac4a1cf0f707ef12d75b9a4fc4a565add4f710b5fcf185d5",
"sha256:62939a8bb6758d1bf923aa1c13f0bcfa9bf5b2fc0f5fa917a6e25db5fe0cfa4e",
"sha256:75830c06a62fe7b8fe3bbb5f269f0b308f19f3949ac81cfd40062f47c1455faf",
"sha256:81992565b74332c7c1aff6a913a3e906771aa81c9d0c68c68113cffcae45bc53",
"sha256:8c892fb0ee52c594d9a7751c7d7356056a9682674b92cc1c4dc968ff0f30c52f",
"sha256:9d862e3cf4fc1f2837dedce9c42269c8c76d027e49820a548ac89fdcee1e361f",
"sha256:a623965c086a6e91bb703d4da62dabe59fe88888e82c4117d544e11fd74835d6",
"sha256:a7783ab7f6a508b0510490cef9f857b763d796ba7476d9703f89722928d1e113",
"sha256:aab09fbe8abfa3b9ce62aaf45aca2d28726b1b9ee44871dbe644050a2fff4940",
"sha256:abf181934ac3ef193832fb973fd7f6149b5c531903c2ec0f1220941d73eee601",
"sha256:ae07fa0c115733fce1e9da96a3ac3fa24801742ca17e917e0c79d63a01eeb843",
"sha256:b9c78242219f674ab645ec571c9a95d70f381319a23911941cd2358a8e0521cf",
"sha256:bccb267678b870d9782c3b44d0cefe3ba0e329f9af8c946d32bf3778e7a4f271",
"sha256:c4df4d27f4c93b2cef74579f00b1d3a31a929c7d8023f870c4b476f03a274db4",
"sha256:caf0e50b546bb60dfa99bb18dfa6748458a83131ecdceaf5c071d74907e7e78a",
"sha256:d3266bd3ac59ac4edcd5fa75165dee80b94a3e5c91049df5f7c057ccf097551c",
"sha256:db0d213987bcd4e6d41710fb4532b22315b0d8fb439ff901782234456556aed1",
"sha256:dbbd5cf7690a40a9f0a9325ab480d0fccf46d16b378eefc08e195d84299bfae1",
"sha256:e16e07a0ec3a75b5ee61f2b1003c35696738f937dc8148fbda9fe2147ccb6e61",
"sha256:e175a006725c7faadbe69e791877d09936c0ef2cf49d01b60a6c1efcb0e8be6f",
"sha256:edd9c13a97f6550f9da2236126bb51c092b3b1ce6187f2bd966533ad794bbb5e",
"sha256:fa39ea60d527fbdd94215b5e5552f1c6a912624521093f1384a491a8ad89ad8b"
],
"version": "==4.2.5"
},
"markdown": {
"hashes": [
"sha256:c00429bd503a47ec88d5e30a751e147dcb4c6889663cd3e2ba0afe858e009baa",
"sha256:d02e0f9b04c500cde6637c11ad7c72671f359b87b9fe924b2383649d8841db7c"
],
"index": "pypi",
"version": "==3.0.1"
},
"markupsafe": {
"hashes": [
"sha256:048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432",
"sha256:130f844e7f5bdd8e9f3f42e7102ef1d49b2e6fdf0d7526df3f87281a532d8c8b",
"sha256:19f637c2ac5ae9da8bfd98cef74d64b7e1bb8a63038a3505cd182c3fac5eb4d9",
"sha256:1b8a7a87ad1b92bd887568ce54b23565f3fd7018c4180136e1cf412b405a47af",
"sha256:1c25694ca680b6919de53a4bb3bdd0602beafc63ff001fea2f2fc16ec3a11834",
"sha256:1f19ef5d3908110e1e891deefb5586aae1b49a7440db952454b4e281b41620cd",
"sha256:1fa6058938190ebe8290e5cae6c351e14e7bb44505c4a7624555ce57fbbeba0d",
"sha256:31cbb1359e8c25f9f48e156e59e2eaad51cd5242c05ed18a8de6dbe85184e4b7",
"sha256:3e835d8841ae7863f64e40e19477f7eb398674da6a47f09871673742531e6f4b",
"sha256:4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3",
"sha256:525396ee324ee2da82919f2ee9c9e73b012f23e7640131dd1b53a90206a0f09c",
"sha256:52b07fbc32032c21ad4ab060fec137b76eb804c4b9a1c7c7dc562549306afad2",
"sha256:52ccb45e77a1085ec5461cde794e1aa037df79f473cbc69b974e73940655c8d7",
"sha256:5c3fbebd7de20ce93103cb3183b47671f2885307df4a17a0ad56a1dd51273d36",
"sha256:5e5851969aea17660e55f6a3be00037a25b96a9b44d2083651812c99d53b14d1",
"sha256:5edfa27b2d3eefa2210fb2f5d539fbed81722b49f083b2c6566455eb7422fd7e",
"sha256:7d263e5770efddf465a9e31b78362d84d015cc894ca2c131901a4445eaa61ee1",
"sha256:83381342bfc22b3c8c06f2dd93a505413888694302de25add756254beee8449c",
"sha256:857eebb2c1dc60e4219ec8e98dfa19553dae33608237e107db9c6078b1167856",
"sha256:98e439297f78fca3a6169fd330fbe88d78b3bb72f967ad9961bcac0d7fdd1550",
"sha256:bf54103892a83c64db58125b3f2a43df6d2cb2d28889f14c78519394feb41492",
"sha256:d9ac82be533394d341b41d78aca7ed0e0f4ba5a2231602e2f05aa87f25c51672",
"sha256:e982fe07ede9fada6ff6705af70514a52beb1b2c3d25d4e873e82114cf3c5401",
"sha256:edce2ea7f3dfc981c4ddc97add8a61381d9642dc3273737e756517cc03e84dd6",
"sha256:efdc45ef1afc238db84cb4963aa689c0408912a0239b0721cb172b4016eb31d6",
"sha256:f137c02498f8b935892d5c0172560d7ab54bc45039de8805075e19079c639a9c",
"sha256:f82e347a72f955b7017a39708a3667f106e6ad4d10b25f237396a7115d8ed5fd",
"sha256:fb7c206e01ad85ce57feeaaa0bf784b97fa3cad0d4a5737bc5295785f5c613a1"
],
"version": "==1.1.0"
},
"netaddr": {
"hashes": [
"sha256:38aeec7cdd035081d3a4c306394b19d677623bf76fa0913f6695127c7753aefd",
"sha256:56b3558bd71f3f6999e4c52e349f38660e54a7a8a9943335f73dfc96883e08ca"
],
"index": "pypi",
"version": "==0.7.19"
},
"oauthlib": {
"hashes": [
"sha256:ac35665a61c1685c56336bda97d5eefa246f1202618a1d6f34fccb1bdd404162",
"sha256:d883b36b21a6ad813953803edfa563b1b579d79ca758fe950d1bc9e8b326025b"
],
"version": "==2.1.0"
},
"olefile": {
"hashes": [
"sha256:133b031eaf8fd2c9399b78b8bc5b8fcbe4c31e85295749bb17a87cba8f3c3964"
],
"version": "==0.46"
},
"pillow": {
"hashes": [
"sha256:00b6a5f28d00f720235a937ebc2f50f4292a5c7e2d6ab9a8b26153b625c4f431",
"sha256:025208f835383f425e93d574842f9c5d28918cd4cdf632c1ce2e72ab80d8fcc8",
"sha256:059a9b4e064b70e1396a3ae64781a91512f773cae548c24b12014616f723f22d",
"sha256:17f7702f22729ffeb69f5226abf3261ef2d2eb73ab5854c1294daa3bdb5bdfb7",
"sha256:20a3549d7a83e969eb900c726d54b34673efc1d0e3c9856b8227350f7e21d968",
"sha256:24258e1875c8a9de1b176bf1873436397669440d1561b06b00eb270bffefcb42",
"sha256:318b4404c8ca34cc1514d60de81ac4a0b0d11031a70341c2b7cd4fc01c914d89",
"sha256:33a71986741227c8c085ee5929171cd4c9376b2eee189cdc7acc7d81e1a3ca84",
"sha256:3499deb97561d6cc75de725fcf744491dd2d10d6213a29c4d62e3980e1522715",
"sha256:3ad24690882b68599b9e6b25309000881eebcc731ca499f8dcc549fab006e4a3",
"sha256:3c05df947656d8538dfb39fb8ddb9fe3594c9345911aa19f07e2ed0a8d148a6d",
"sha256:48cdae5e5291d355fc215ede2ea93738e243c2467b11e41fa5010a76fd278fc5",
"sha256:4b382c0ee6ac822673e1a57c2e9878d2ac4cd52038be097bac8535a2ee60ec0e",
"sha256:6458293cf299f02f17f58a1ee4b91f77b8ce7a38bc0e757838767f1389479953",
"sha256:8ef6627adfe9314b4132d4f5207563ba147e3977019ab1ca3f0b11b04c83c84f",
"sha256:9c508bf0b2aadad4349f69aebe080977dbf0cd055cefc15793c4165851a96933",
"sha256:9d7c0706cd86fc17643d78674cdac7f05590a2da1d71c42c2ebfb27df3889f17",
"sha256:a2a873b54881c4cf4d8b37f3c426c2b8f797b341e3893650763a62252bda3922",
"sha256:b79fc81352a3c907a1223499d790a4a7b77be342b794e19628046c4c95676356",
"sha256:c040a047209edaf860ce6dd5b55de718e047144b26b0ee4198dd19907c128eac",
"sha256:d71992826cfed66f5ad68364b2c6c3c1ab305294a642deae96ad77004981fb0f",
"sha256:e467d0977997b43ca80b7af42de3d1cfa779988f6507965e6d4fb1a004e963a0",
"sha256:ecf810b5019ce62846a9203bab82eb02bb9ed60e258b2fd89e2ca19a7010da46",
"sha256:f4fb801bfd2bcbfc4a7f2819c95ea6a1cfef197420ae9849b01b08b9970a51b3",
"sha256:f63404731fa5fa0c21d00af119b867e30208e3fc148c9b13fb6a541a8df203b2",
"sha256:f8e8f3f20e32f73f81ec408061f7a81ada07d7b3fac0787bdd233b93e4ff7d9c",
"sha256:fb3eaba16b6cf01f12860edccac40f98362bc17225575f3bcabb333d0b4ed6dc"
],
"index": "pypi",
"version": "==4.1.1"
},
"premailer": {
"hashes": [
"sha256:25c97c4c1838a8045ed1da1a14bd82ce458687878aa162378a78aa82a6aec6af",
"sha256:4e71cc09ad1438f827d1070ffac54ceb3a6a07c995fa82cb34c1ef163adeb432"
],
"index": "pypi",
"version": "==3.0.1"
},
"psd-tools": {
"hashes": [
"sha256:1a8dd69783c84217f3a25938916c289e5653543c5610e9013769520e8bd65b3c",
"sha256:7f3fd8577fb627405a204a65d4ccea48299f95338a71fbd9709bdb9d7789cc4e",
"sha256:f519a08049c19b3ef37ccc2b39af11ac5ded59d2674fc4c28103e4db57a9aa99"
],
"index": "pypi",
"version": "==1.4"
},
"psycopg2-binary": {
"hashes": [
"sha256:04afb59bbbd2eab3148e6816beddc74348078b8c02a1113ea7f7822f5be4afe3",
"sha256:098b18f4d8857a8f9b206d1dc54db56c2255d5d26458917e7bcad61ebfe4338f",
"sha256:0bf855d4a7083e20ead961fda4923887094eaeace0ab2d76eb4aa300f4bbf5bd",
"sha256:197dda3ffd02057820be83fe4d84529ea70bf39a9a4daee1d20ffc74eb3d042e",
"sha256:278ef63afb4b3d842b4609f2c05ffbfb76795cf6a184deeb8707cd5ed3c981a5",
"sha256:3cbf8c4fc8f22f0817220891cf405831559f4d4c12c4f73913730a2ea6c47a47",
"sha256:4305aed922c4d9d6163ab3a41d80b5a1cfab54917467da8168552c42cad84d32",
"sha256:47ee296f704fb8b2a616dec691cdcfd5fa0f11943955e88faa98cbd1dc3b3e3d",
"sha256:4a0e38cb30457e70580903367161173d4a7d1381eb2f2cfe4e69b7806623f484",
"sha256:4d6c294c6638a71cafb82a37f182f24321f1163b08b5d5ca076e11fe838a3086",
"sha256:4f3233c366500730f839f92833194fd8f9a5c4529c8cd8040aa162c3740de8e5",
"sha256:5221f5a3f4ca2ddf0d58e8b8a32ca50948be9a43351fda797eb4e72d7a7aa34d",
"sha256:5c6ca0b507540a11eaf9e77dee4f07c131c2ec80ca0cffa146671bf690bc1c02",
"sha256:789bd89d71d704db2b3d5e67d6d518b158985d791d3b2dec5ab85457cfc9677b",
"sha256:7b94d29239efeaa6a967f3b5971bd0518d2a24edd1511edbf4a2c8b815220d07",
"sha256:89bc65ef3301c74cf32db25334421ea6adbe8f65601ea45dcaaf095abed910bb",
"sha256:89d6d3a549f405c20c9ae4dc94d7ed2de2fa77427a470674490a622070732e62",
"sha256:97521704ac7127d7d8ba22877da3c7bf4a40366587d238ec679ff38e33177498",
"sha256:a395b62d5f44ff6f633231abe568e2203b8fabf9797cd6386aa92497df912d9a",
"sha256:a6d32c37f714c3f34158f3fa659f3a8f2658d5f53c4297d45579b9677cc4d852",
"sha256:a89ee5c26f72f2d0d74b991ce49e42ddeb4ac0dc2d8c06a0f2770a1ab48f4fe0",
"sha256:b4c8b0ef3608e59317bfc501df84a61e48b5445d45f24d0391a24802de5f2d84",
"sha256:b5fcf07140219a1f71e18486b8dc28e2e1b76a441c19374805c617aa6d9a9d55",
"sha256:b86f527f00956ecebad6ab3bb30e3a75fedf1160a8716978dd8ce7adddedd86f",
"sha256:be4c4aa22ba22f70de36c98b06480e2f1697972d49eb20d525f400d204a6d272",
"sha256:c2ac7aa1a144d4e0e613ac7286dae85671e99fe7a1353954d4905629c36b811c",
"sha256:de26ef4787b5e778e8223913a3e50368b44e7480f83c76df1f51d23bd21cea16",
"sha256:e70ebcfc5372dc7b699c0110454fc4263967f30c55454397e5769eb72c0eb0ce",
"sha256:eadbd32b6bc48b67b0457fccc94c86f7ccc8178ab839f684eb285bb592dc143e",
"sha256:ecbc6dfff6db06b8b72ae8a2f25ff20fbdcb83cb543811a08f7cb555042aa729"
],
"index": "pypi",
"version": "==2.7.5"
},
"pycparser": {
"hashes": [
"sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3"
],
"version": "==2.19"
},
"pygments": {
"hashes": [
"sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d",
"sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
],
"index": "pypi",
"version": "==2.2.0"
},
"pyjwt": {
"hashes": [
"sha256:00414bfef802aaecd8cc0d5258b6cb87bd8f553c2986c2c5f29b19dd5633aeb7",
"sha256:ddec8409c57e9d371c6006e388f91daf3b0b43bdf9fcbf99451fb7cf5ce0a86d"
],
"version": "==1.7.0"
},
"python-dateutil": {
"hashes": [
"sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93",
"sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02"
],
"index": "pypi",
"version": "==2.7.5"
},
"python-magic": {
"hashes": [
"sha256:604eace6f665809bebbb07070508dfa8cabb2d7cb05be9a56706c60f864f1289",
"sha256:a1ec69e76cc513b1af164c02982607f96ff3bb668162a688f2b1bb5f6a5fe05d"
],
"index": "pypi",
"version": "==0.4.13"
},
"pytz": {
"hashes": [
"sha256:31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca",
"sha256:8e0f8568c118d3077b46be7d654cc8167fa916092e28320cde048e54bfc9f1e6"
],
"index": "pypi",
"version": "==2018.7"
},
"raven": {
"hashes": [
"sha256:02cabffb173b99d860a95d4908e8b1864aad1b8452146e13fd7e212aa576a884",
"sha256:56dc9062dd42bca97350e5048ff417c914376366caa3b1b5f788b27ddc0a34b7"
],
"index": "pypi",
"version": "==6.1.0"
},
"redis": {
"hashes": [
"sha256:5dfbae6acfc54edf0a7a415b99e0b21c0a3c27a7f787b292eea727b1facc5533",
"sha256:97156b37d7cda4e7d8658be1148c983984e1a975090ba458cc7e244025191dbd"
],
"index": "pypi",
"version": "==2.10.5"
},
"requests": {
"hashes": [
"sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c",
"sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279"
],
"index": "pypi",
"version": "==2.20.0"
},
"requests-oauthlib": {
"hashes": [
"sha256:50a8ae2ce8273e384895972b56193c7409601a66d4975774c60c2aed869639ca",
"sha256:883ac416757eada6d3d07054ec7092ac21c7f35cb1d2cf82faf205637081f468"
],
"version": "==0.8.0"
},
"sampledata": {
"hashes": [
"sha256:b06916ef010d3c1a9db8aa314a144f24ad421f28597ff8c568603c451391a2cf"
],
"version": "==0.3.7"
},
"serpy": {
"hashes": [
"sha256:b1481f8cb93d767b23903d1df6cc0a7120cb0694095b6695eb78d9d453b23c65",
"sha256:b774bfdf0c3b245660639e9fc5f311a8bbceb2725aaba72fce1fec00b453286e"
],
"index": "pypi",
"version": "==0.1.1"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
],
"version": "==1.11.0"
},
"tinycss": {
"hashes": [
"sha256:12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e"
],
"version": "==0.4"
},
"unidecode": {
"hashes": [
"sha256:ed4418b4b1b190487753f1cca6299e8076079258647284414e6d607d1f8a00e0",
"sha256:eedac7bfd886f43484787206f6a141b232e2b2a58652c54d06499b187fd84660"
],
"index": "pypi",
"version": "==0.4.20"
},
"urllib3": {
"hashes": [
"sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39",
"sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
],
"version": "==1.24.1"
},
"vine": {
"hashes": [
"sha256:52116d59bc45392af9fdd3b75ed98ae48a93e822cee21e5fda249105c59a7a72",
"sha256:6849544be74ec3638e84d90bc1cf2e1e9224cc10d96cd4383ec3f69e9bce077b"
],
"version": "==1.1.4"
},
"webcolors": {
"hashes": [
"sha256:e47e68644d41c0b1f1e4d939cfe4039bdf1ab31234df63c7a4f59d4766487206"
],
"index": "pypi",
"version": "==1.7"
},
"webencodings": {
"hashes": [
"sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
"sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
],
"version": "==0.5.1"
}
},
"develop": {
"atomicwrites": {
"hashes": [
"sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
"sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
],
"version": "==1.2.1"
},
"attrs": {
"hashes": [
"sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69",
"sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb"
],
"version": "==18.2.0"
},
"certifi": {
"hashes": [
"sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7",
"sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"
],
"version": "==2018.11.29"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"coverage": {
"hashes": [
"sha256:09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f",
"sha256:0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe",
"sha256:0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d",
"sha256:10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0",
"sha256:1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607",
"sha256:1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d",
"sha256:2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b",
"sha256:447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3",
"sha256:46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e",
"sha256:4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815",
"sha256:510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36",
"sha256:5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1",
"sha256:5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14",
"sha256:5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c",
"sha256:6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794",
"sha256:6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b",
"sha256:77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840",
"sha256:828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd",
"sha256:85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82",
"sha256:8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952",
"sha256:a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389",
"sha256:aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f",
"sha256:ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4",
"sha256:b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da",
"sha256:bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647",
"sha256:c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d",
"sha256:d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42",
"sha256:d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478",
"sha256:da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b",
"sha256:ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb",
"sha256:ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9"
],
"index": "pypi",
"version": "==4.5.2"
},
"coveralls": {
"hashes": [
"sha256:ab638e88d38916a6cedbf80a9cd8992d5fa55c77ab755e262e00b36792b7cd6d",
"sha256:b2388747e2529fa4c669fb1e3e2756e4e07b6ee56c7d9fce05f35ccccc913aa0"
],
"index": "pypi",
"version": "==1.5.1"
},
"docopt": {
"hashes": [
"sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
],
"version": "==0.6.2"
},
"factory-boy": {
"hashes": [
"sha256:6f25cc4761ac109efd503f096e2ad99421b1159f01a29dbb917359dcd68e08ca",
"sha256:d552cb872b310ae78bd7429bf318e42e1e903b1a109e899a523293dfa762ea4f"
],
"index": "pypi",
"version": "==2.11.1"
},
"faker": {
"hashes": [
"sha256:c61a41d0dab8865b850bd00454fb11e90f3fd2a092d8bc90120d1e1c01cff906",
"sha256:f909ff9133ce0625ca388b6838190630ad7a593f87eaf058d872338a76241d5d"
],
"version": "==1.0.0"
},
"idna": {
"hashes": [
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
],
"version": "==2.7"
},
"more-itertools": {
"hashes": [
"sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092",
"sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e",
"sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d"
],
"version": "==4.3.0"
},
"pluggy": {
"hashes": [
"sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095",
"sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f"
],
"version": "==0.8.0"
},
"py": {
"hashes": [
"sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694",
"sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6"
],
"version": "==1.7.0"
},
"pytest": {
"hashes": [
"sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec",
"sha256:e246cf173c01169b9617fc07264b7b1316e78d7a650055235d6d897bc80d9660"
],
"index": "pypi",
"version": "==3.10.1"
},
"pytest-django": {
"hashes": [
"sha256:49e9ffc856bc6a1bec1c26c5c7b7213dff7cc8bc6b64d624c4d143d04aff0bcf",
"sha256:b379282feaf89069cb790775ab6bbbd2bd2038a68c7ef9b84a41898e0b551081"
],
"index": "pypi",
"version": "==3.4.3"
},
"python-dateutil": {
"hashes": [
"sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93",
"sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02"
],
"index": "pypi",
"version": "==2.7.5"
},
"requests": {
"hashes": [
"sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c",
"sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279"
],
"index": "pypi",
"version": "==2.20.0"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
],
"version": "==1.11.0"
},
"text-unidecode": {
"hashes": [
"sha256:5a1375bb2ba7968740508ae38d92e1f889a0832913cb1c447d5e2046061a396d",
"sha256:801e38bd550b943563660a91de8d4b6fa5df60a542be9093f7abf819f86050cc"
],
"version": "==1.2"
},
"urllib3": {
"hashes": [
"sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39",
"sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
],
"version": "==1.24.1"
}
}
}

View File

@ -1,10 +1,88 @@
# Taiga Backend # # Taiga Backend #
![Kaleidos Project](http://kaleidos.net/static/img/badge.png "Kaleidos Project") [![Kaleidos Project](http://kaleidos.net/static/img/badge.png)](https://github.com/kaleidos "Kaleidos Project")
[![Managed with Taiga.io](https://img.shields.io/badge/managed%20with-TAIGA.io-709f14.svg)](https://tree.taiga.io/project/taiga/ "Managed with Taiga.io")
[![Build Status](https://img.shields.io/travis/taigaio/taiga-back.svg)](https://travis-ci.org/taigaio/taiga-back "Build Status")
[![Coverage Status](https://img.shields.io/coveralls/taigaio/taiga-back/master.svg)](https://coveralls.io/r/taigaio/taiga-back?branch=master "Coverage Status")
## Contribute to Taiga ##
#### Where to start ####
There are many different ways to contribute to Taiga's development, just find the one that best fits with your skills. Examples of contributions we would love to receive include:
- **Code patches**
- **Documentation improvements**
- **Translations**
- **Bug reports**
- **Patch reviews**
- **UI enhancements**
Big features are also welcome but if you want to see your contributions included in Taiga codebase we strongly recommend you start by initiating a chat though our [mailing list](http://groups.google.co.uk/d/forum/taigaio)
#### Code of Conduct ####
Help us keep the Taiga Community open and inclusive. Please read and follow our [Code of Conduct](https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md).
#### License ####
Every code patch accepted in taiga codebase is licensed under [AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html). You must be careful to not include any code that can not be licensed under this license.
Please read carefully [our license](https://github.com/taigaio/taiga-back/blob/master/LICENSE) and ask us if you have any questions as well as the [Contribution policy](https://github.com/taigaio/taiga-back/blob/master/CONTRIBUTING.md).
#### Bug reports, enhancements and support ####
If you **need help to setup Taiga**, want to **talk about some cool enhancemnt** or you have **some questions**, please write us to our [mailing list](http://groups.google.com/d/forum/taigaio).
If you **find a bug** in Taiga you can always report it:
- in our [mailing list](http://groups.google.com/d/forum/taigaio).
- in [github issues](https://github.com/taigaio/taiga-back/issues).
- send us a mail to support@taiga.io if is a bug related to [tree.taiga.io](https://tree.taiga.io).
- send a mail to security@taiga.io if is a **security bug**.
One of our fellow Taiga developers will search, find and hunt it as soon as possible.
Please, before reporting a bug write down how can we reproduce it, your operating system, your browser and version, and if it's possible, a screenshot. Sometimes it takes less time to fix a bug if the developer knows how to find it and we will solve your problem as fast as possible.
#### Documentation improvements ####
We are gathering lots of information from our users to build and enhance our documentation. If you use the documentation to install or develop with Taiga and find any mistakes, omissions or confused sequences, it is enormously helpful to report it. Or better still, if you believe you can author additions, please make a pull-request to taiga project.
Currently, we have authored three main documentation hubs:
- **[API Docs](https://github.com/taigaio/taiga-doc)**: Our API documentation and reference for developing from Taiga API.
- **[Installation Guide](https://github.com/taigaio/taiga-doc)**: If you need to install Taiga on your own server, this is the place to find some guides.
- **[Taiga Support](https://github.com/taigaio/taiga-doc)**: This page is intended to be the support reference page for the users. If you find any mistake, please report it.
#### Translation ####
We are ready now to accept your help translating Taiga. It's easy (and fun!) just access our team of translators with the link below, set up an account in Transifex and start contributing. Join us to make sure your language is covered! **[Help Taiga to translate content](https://www.transifex.com/taiga-agile-llc/taiga-back/ "Help Taiga to trasnlatecontent")**
#### Code patches ####
Taiga will always be glad to receive code patches to update, fix or improve its code.
If you know how to improve our code base or you found a bug, a security vulnerability or a performance issue and you think you can solve it, we will be very happy to accept your pull-request. If your code requires considerable changes, we recommend you first talk to us directly. We will find the best way to help.
#### UI enhancements ####
Taiga is made for developers and designers. We care enormously about UI because usability and design are both critical aspects of the Taiga experience.
There are two possible ways to contribute to our UI:
- **Bugs**: If you find a bug regarding front-end, please report it as previously indicated in the Bug reports section or send a pull-request as indicated in the Code Patches section.
- **Enhancements**: If its a design or UX bug or enhancement we will love to receive your feedback. Please send us your enhancement, with the reason and, if possible, an example. Our design and UX team will review your enhancement and fix it as soon as possible. We recommend you to use our [mailing list](http://groups.google.co.uk/d/forum/taigaio) so we can have a lot of different opinions and debate.
- **Language Localization**: We are eager to offer localized versions of Taiga. Some members of the community have already volunteered to work to provide a variety of languages. We are working to implement some changes to allow for this and expect to accept these requests in the near future.
[![Travis Badge](https://img.shields.io/travis/taigaio/taiga-back.svg?style=flat)](https://travis-ci.org/taigaio/taiga-back "Travis Badge")
[![Coveralls](http://img.shields.io/coveralls/taigaio/taiga-back.svg?style=flat)](https://travis-ci.org/taigaio/taiga-back "Coveralls")
## Setup development environment ## ## Setup development environment ##
@ -15,19 +93,12 @@ pip install -r requirements.txt
python manage.py migrate --noinput python manage.py migrate --noinput
python manage.py loaddata initial_user python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates python manage.py loaddata initial_project_templates
python manage.py loaddata initial_role
python manage.py sample_data python manage.py sample_data
``` ```
Taiga only runs with python 3.4+ **IMPORTANT: Taiga only runs with python 3.5+**
Initial auth data: admin/123123 Initial auth data: admin/123123
If you want a complete environment for production usage, you can try the taiga bootstrapping If you want a complete environment for production usage, you can try the taiga bootstrapping
scripts https://github.com/taigaio/taiga-scripts (warning: alpha state) scripts https://github.com/taigaio/taiga-scripts (warning: alpha state). All the information about the different installation methods (production, development, vagrant, docker...) can be found here http://taigaio.github.io/taiga-doc/dist/#_installation_guide.
## Community ##
[Taiga has a mailing list](http://groups.google.com/d/forum/taigaio). Feel free to join it and ask any questions you may have.
To subscribe for announcements of releases, important changes and so on, please follow [@taigaio](https://twitter.com/taigaio) on Twitter.

1
doc/.gitignore vendored
View File

@ -1 +0,0 @@
build

View File

@ -1,153 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Green-Mine.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Green-Mine.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Green-Mine"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Green-Mine"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

View File

@ -1,39 +0,0 @@
{% extends "!layout.html" %}
{% block body %}
<div class="deck">
{% if version == "0.7" or version == "0.8" %}
<p class="developmentversion">
This document is for Celery's development version, which can be
significantly different from previous releases. Get old docs here:
<a href="http://docs.celeryproject.org/en/latest/{{ pagename }}{{ file_suffix }}">2.5</a>.
</p>
{% else %}
<p>
This document describes stdnet {{ version }}. For development docs,
<a href="http://lsbardel.github.com/python-stdnet/{{ pagename }}{{ file_suffix }}">go here</a>.
</p>
{% endif %}
</div>
{{ body }}
{% endblock %}
{% block footer %}
{{ super() }}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3900561-6']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{% endblock %}

View File

@ -1,9 +0,0 @@
<h3>Green-Mine</h3>
<p>
Green-Mine is a project managment web application
build on top of django (1.4).
</p>
<h3>Useful Links</h3>
<ul>
<li><a href="https://github.com/lsbardel/python-stdnet">Green-Mine @ github</a></li>
</ul>

View File

@ -1,5 +0,0 @@
<p class="logo">
<a href="{{ pathto(master_doc) }}">
<img class="logo" width="200" src="{{ pathto('_static/net.jpg', 1) }}" alt="Logo"/>
</a>
</p>

View File

@ -1,394 +0,0 @@
/*
* celery.css_t
* ~~~~~~~~~~~~
*
* :copyright: Copyright 2010 by Armin Ronacher.
* :license: BSD, see LICENSE for details.
*/
{% set page_width = 940 %}
{% set sidebar_width = 220 %}
{% set body_font_stack = 'Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif' %}
{% set headline_font_stack = 'Futura, "Trebuchet MS", Arial, sans-serif' %}
{% set code_font_stack = "'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace" %}
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: {{ body_font_stack }};
font-size: 17px;
background-color: white;
color: #000;
margin: 30px 0 0 0;
padding: 0;
}
div.document {
width: {{ page_width }}px;
margin: 0 auto;
}
div.related {
width: {{ page_width - 20 }}px;
padding: 5px 10px;
background: #F2FCEE;
margin: 15px auto 15px auto;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 {{ sidebar_width }}px;
}
div.sphinxsidebar {
width: {{ sidebar_width }}px;
}
hr {
border: 1px solid #B1B4B6;
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 0 30px;
}
img.celerylogo {
padding: 0 0 10px 10px;
float: right;
}
div.footer {
width: {{ page_width - 15 }}px;
margin: 10px auto 30px auto;
padding-right: 15px;
font-size: 14px;
color: #888;
text-align: right;
}
div.footer a {
color: #888;
}
div.sphinxsidebar a {
color: #444;
text-decoration: none;
border-bottom: 1px dashed #DCF0D5;
}
div.sphinxsidebar a:hover {
border-bottom: 1px solid #999;
}
div.sphinxsidebar {
font-size: 14px;
line-height: 1.5;
}
div.sphinxsidebarwrapper {
padding: 7px 10px;
}
div.sphinxsidebarwrapper p.logo {
padding: 0 0 20px 0;
margin: 0;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: {{ headline_font_stack }};
color: #444;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}
div.sphinxsidebar h4 {
font-size: 20px;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
border: none;
}
div.sphinxsidebar p {
color: #555;
margin: 10px 0;
}
div.sphinxsidebar ul {
margin: 10px 0;
padding: 0;
color: #000;
}
div.sphinxsidebar input {
border: 1px solid #ccc;
font-family: {{ body_font_stack }};
font-size: 1em;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #348613;
text-decoration: underline;
}
a:hover {
color: #59B833;
text-decoration: underline;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: {{ headline_font_stack }};
font-weight: normal;
margin: 30px 0px 10px 0px;
padding: 0;
}
div.body h1 { margin-top: 0; padding-top: 0; font-size: 200%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
div.body h1 a.toc-backref,
div.body h2 a.toc-backref,
div.body h3 a.toc-backref,
div.body h4 a.toc-backref,
div.body h5 a.toc-backref,
div.body h6 a.toc-backref {
color: inherit!important;
text-decoration: none;
}
a.headerlink {
color: #ddd;
padding: 0 4px;
text-decoration: none;
}
a.headerlink:hover {
color: #444;
background: #eaeaea;
}
div.body p, div.body dd, div.body li {
line-height: 1.4em;
}
div.admonition {
background: #fafafa;
margin: 20px -30px;
padding: 10px 30px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
div.admonition p.admonition-title {
font-family: {{ headline_font_stack }};
font-weight: normal;
font-size: 24px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
}
div.admonition p.last {
margin-bottom: 0;
}
div.highlight{
background-color: white;
}
dt:target, .highlight {
background: #FAF3E8;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre, tt {
font-family: {{ code_font_stack }};
font-size: 0.9em;
}
img.screenshot {
}
tt.descname, tt.descclassname {
font-size: 0.95em;
}
tt.descname {
padding-right: 0.08em;
}
img.screenshot {
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils {
border: 1px solid #888;
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils td, table.docutils th {
border: 1px solid #888;
padding: 0.25em 0.7em;
}
table.field-list, table.footnote {
border: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
table.footnote {
margin: 15px 0;
width: 100%;
border: 1px solid #eee;
background: #fdfdfd;
font-size: 0.9em;
}
table.footnote + table.footnote {
margin-top: -15px;
border-top: none;
}
table.field-list th {
padding: 0 0.8em 0 0;
}
table.field-list td {
padding: 0;
}
table.footnote td.label {
width: 0px;
padding: 0.3em 0 0.3em 0.5em;
}
table.footnote td {
padding: 0.3em 0.5em;
}
dl {
margin: 0;
padding: 0;
}
dl dd {
margin-left: 30px;
}
blockquote {
margin: 0 0 0 30px;
padding: 0;
}
ul {
margin: 10px 0 10px 30px;
padding: 0;
}
pre {
background: #F0FFEB;
padding: 7px 10px;
margin: 15px 0;
border: 1px solid #C7ECB8;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
line-height: 1.3em;
}
tt {
background: #F0FFEB;
color: #222;
/* padding: 1px 2px; */
}
tt.xref, a tt {
background: #F0FFEB;
border-bottom: 1px solid white;
}
a.reference {
text-decoration: none;
border-bottom: 1px dashed #DCF0D5;
}
a.reference:hover {
border-bottom: 1px solid #6D4100;
}
a.footnote-reference {
text-decoration: none;
font-size: 0.7em;
vertical-align: top;
border-bottom: 1px dashed #DCF0D5;
}
a.footnote-reference:hover {
border-bottom: 1px solid #6D4100;
}
a:hover tt {
background: #EEE;
}

View File

@ -1,5 +0,0 @@
[theme]
inherit = basic
stylesheet = celery.css
[options]

View File

@ -1,57 +0,0 @@
============
Coding rules
============
Django models
=============
* All model names in singular an CamelCase.
* All models have a **Meta** with at least:
- **verbose_name** and **verbose_name_plural**: unicode strings, lowercase, with spaces.
- **ordering**: return a consistent order, using pk if no other unique field or combination exists.
* All models have **__unicode__** method, returning a human-readable, descriptive, short text.
* All fields have **verbose_name**. Also **help_text** if needed to fully explain the field meaning.
* All fields have explicit **blank** and **null** parameters. Use only those combinations, unless
there a documented need of other thing:
Normal fields (IntegerField, DateField, ForeignKey, FileField...)
- (optional) **null = True**, **blank = True**
- (required) **null = False**, **blank = False**
Text fields (CharField, TextField, URLField...)
- (optional) **null = False**, **blank = True**
- (required) **null = False**, **blank = False**
Boolean fields:
- (two values, T/F) **null = False**, **blank = True**
- (three values, T/F/Null) **null = False**, **blank = True**
* Don't create text fields with **null = True**, unless you need to distinguish between empty string and None.
* Don't create boolean fields with **blank = False**, otherwise they could only be True.
Example::
class SomeClass(models.Model):
name = models.CharField(max_length=100, null = False, blank = False, unique=True,
verbose_name = _(u'name'))
slug = models.SlugField(max_length=100, null = False, blank = False, unique=True,
verbose_name = _(u'slug'),
help_text = (u'Identifier of this object. Only letters, digits and underscore "_" allowed.'))
text = models.TextField(null = False, blank = True,
verbose_name = _(u'text'))
class Meta:
verbose_name = _(u'some class')
verbose_name_plural = _(u'some classes')
ordering = ['name']
def __unicode__(self):
return self.name

View File

@ -1,255 +0,0 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'taiga'
copyright = u'2012, Andrei Antoukh'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.10'
# The full version, including alpha/beta/rc tags.
release = '0.0.10'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'celery'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_theme_path = ["_theme"]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
html_sidebars = {
'index': ['sidebarlogo.html', 'sidebarintro.html',
'sourcelink.html', 'searchbox.html'],
'**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',
'sourcelink.html', 'searchbox.html'],
}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'taigadoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'taiga.tex', u'taiga documentation',
u'Andrei Antoukh', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'green-mine', u'taiga documentation',
[u'Andrei Antoukh'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'taiga', u'taiga documentation',
u'Andrei Antoukh', 'taiga', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

View File

@ -1,43 +0,0 @@
==========
Green-Mine
==========
.. rubric:: Project management web application build on top of Django.
Currently there is no stable version, but the project is already usable. All contributions and bug fixes is welcome.
First steps
===========
**From scratch:**
:ref:`Overview and Installation <intro-overview>`
**Tutorials:** TODO
**Miscellaneous:**
:ref:`Contributing <contributing>` |
:ref:`Tests <runtests>` |
:ref:`Changelog <changelog>` |
:ref:`License <license>`
Contents:
=========
.. toctree::
:maxdepth: 1
overview.rst
settings.rst
coding_rules.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -1,78 +0,0 @@
.. _intro-overview:
========
Overview
========
Requirements
============
* python 2.6 or 2.7
* django-superview >= 0.2
* psycopg2 >= 2.4 (if postgresql is used)
* pyzmq >= 2.2 (for async mailserver)
* sphinx >= 1.1.3 (for build this documentation)
* django >= 1.4 (builtin)
* markdown >= 2.1 (for markdown wiki)
* docutils >= 0.7 (for restructuredtext wiki)
Philosophy
==========
TODO
Installing
==========
TODO
Version Check
=============
TODO
.. _runtests:
Running tests
=============
Requirements for running tests: same as standard requierements.
To run tests, open a shell on a package directory and type::
python manage.py test -v2 taiga
To access coverage of tests you need to install the coverage_ package and run the tests using::
coverage run --omit=extern manage.py test -v2 taiga
and to check out the coverage report::
coverage html
.. _contributing:
Contributing
============
Develpment of Green-Mine happens at github: https://github.com/niwibe/Green-Mine
We very much welcome your contribution of course. To do so, simply follow these guidelines:
1. Fork ``taiga`` on github.
2. Create feature branch. Example: ``git checkout -b my_new_feature``
3. Push your changes. Example: ``git push -u origin my_new_feature``
4. Send me a pull-request.
.. _license:
License
=======
This software is licensed under the `GNU Affero General Public License`_, Version
3. See the LICENSE file in the top distribution directory for the full license
text.
.. _coverage: http://nedbatchelder.com/code/coverage/
.. _`GNU Affero General Public License`: http://www.gnu.org/licenses/agpl.html

View File

@ -1,22 +0,0 @@
Settings introduced by taiga.
=============================
Default settings
----------------
The setting instance contains few default parameters used in throughout
the library. This parameters can be changed by the user by simply
overriding them.
.. attribute:: settings.HOST
Set a full host name, this is used for making urls for email
notifications. In the future, it will be automatic.
Default: ``"http://localhost:8000"`` (ready for developers)
.. attribute:: settings.DISABLE_REGISTRATION
Set this, disables user registration.
Default: ``False``

View File

@ -1,4 +1,23 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys import sys

View File

@ -1,3 +1,6 @@
[pytest] [pytest]
DJANGO_SETTINGS_MODULE = settings.testing DJANGO_SETTINGS_MODULE = settings.testing
python_paths = . filterwarnings =
once
ignore::django.utils.deprecation.RemovedInDjango20Warning
ignore::DeprecationWarning:taiga.base.api.serializers

View File

@ -1,20 +1,37 @@
#!/bin/bash #!/bin/bash
# For postgresql show_answer=true
while [ $# -gt 0 ]; do
case "$1" in
-y)
show_answer=false
;;
esac
shift
done
if $show_answer ; then
echo "WARNING!! This script REMOVE your Taiga's database and you LOSE all the data."
read -p "Are you sure you want to delete all data? (Press Y to continue): " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]] ; then
exit 1
fi
fi
echo "-> Remove taiga DB" echo "-> Remove taiga DB"
dropdb taiga dropdb taiga
echo "-> Create taiga DB" echo "-> Create taiga DB"
createdb taiga createdb taiga
echo "-> Run syncdb" echo "-> Load migrations"
python manage.py migrate python manage.py migrate
# echo "-> Load initial Site" echo "-> Load initial user (admin/123123)"
# python manage.py loaddata initial_site --traceback
echo "-> Load initial user"
python manage.py loaddata initial_user --traceback python manage.py loaddata initial_user --traceback
echo "-> Load initial project_templates" echo "-> Load initial project_templates (scrum/kanban)"
python manage.py loaddata initial_project_templates --traceback python manage.py loaddata initial_project_templates --traceback
echo "-> Load initial roles"
python manage.py loaddata initial_role --traceback
echo "-> Generate sample data" echo "-> Generate sample data"
python manage.py sample_data --traceback python manage.py sample_data --traceback
echo "-> Rebuilding timeline"
python manage.py rebuild_timeline --purge

View File

@ -1,11 +0,0 @@
-r requirements.txt
factory_boy==2.4.1
py==1.4.23
pytest==2.6.1
pytest-django==2.6.2
pytest-pythonpath==0.3
coverage==3.7.1
coveralls==0.4.2
django-slowdown==0.0.1

View File

@ -1,32 +1,63 @@
djangorestframework==2.3.13 -i https://pypi.org/simple
Django==1.7 amqp==2.3.2
django-picklefield==0.3.1 asana==0.6.7
django-sampledatahelper==0.2.2 asn1crypto==0.24.0
gunicorn==18.0 billiard==3.5.0.5
psycopg2==2.5.4 bleach==2.1.4
pillow==2.5.3 cairocffi==0.9.0
pytz==2014.4 cairosvg==2.0.3
six==1.8.0 celery==4.0.2
amqp==1.4.6 certifi==2018.11.29
djmail==0.9 cffi==1.11.5
django-pgjson==0.2.0 chardet==3.0.4
djorm-pgarray==1.0.4 contextlib2==0.5.5
django-jinja==1.0.4 cryptography==2.3.1
jinja2==2.7.2 cssselect==1.0.3
pygments==1.6 cssutils==1.0.2
django-sites==0.8
Markdown==2.4.1
fn==0.2.13
diff-match-patch==20121119 diff-match-patch==20121119
requests==2.4.1 django-ipware==1.1.6
Unidecode==0.04.16 django-jinja==2.3.1
django-pglocks==1.0.2
# Comment it if you are using python >= 3.4 django-picklefield==0.3.2
enum34==1.0 django-sampledatahelper==0.4.1
easy-thumbnails==2.1 django-sites==0.9
celery==3.1.12 django-sr==0.0.4
redis==2.10.3 django==1.11.16
Unidecode==0.04.16 djmail==1.0.1
docopt==0.6.2
# Comment it if you are using python >= 3.4 easy-thumbnails==2.4.1
enum34==1.0 fn==0.4.3
gunicorn==19.7.1
html5lib==1.0.1
idna==2.7
jinja2==2.10
kombu==4.0.2
lxml==4.2.5
markdown==3.0.1
markupsafe==1.1.0
netaddr==0.7.19
oauthlib==2.1.0
olefile==0.46
pillow==4.1.1
premailer==3.0.1
psd-tools==1.4
psycopg2-binary==2.7.5
pycparser==2.19
pygments==2.2.0
pyjwt==1.7.0
python-dateutil==2.7.5
python-magic==0.4.13
pytz==2018.7
raven==6.1.0
redis==2.10.5
requests-oauthlib==0.8.0
requests==2.20.0
sampledata==0.3.7
serpy==0.1.1
six==1.11.0
tinycss==0.4
unidecode==0.4.20
urllib3==1.24.1
vine==1.1.4
webcolors==1.7
webencodings==0.5.1

View File

@ -0,0 +1,6 @@
#!/bin/bash
python ./manage.py dumpdata --format json \
--indent 4 \
--output './taiga/projects/fixtures/initial_project_templates.json' \
'projects.ProjectTemplate'

280
scripts/manage_translations.py Executable file
View File

@ -0,0 +1,280 @@
#!/usr/bin/env python
#
# NOTE: This script is based on django's manage_translations.py script
# (https://github.com/django/django/blob/master/scripts/manage_translations.py)
#
# This python file contains utility scripts to manage taiga translations.
# It has to be run inside the taiga-back git root directory.
#
# The following commands are available:
#
# * update_catalogs: check for new strings in taiga-back catalogs, and
# output how much strings are new/changed.
#
# * lang_stats: output statistics for each catalog/language combination
#
# * fetch: fetch translations from transifex.com
#
# * commit: update resources in transifex.com with the local files
#
# Each command support the --languages and --resources options to limit their
# operation to the specified language or resource. For example, to get stats
# for Spanish in contrib.admin, run:
#
# $ python scripts/manage_translations.py lang_stats --language=es --resources=taiga
import os
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
from subprocess import PIPE, Popen, call
from django_jinja.management.commands import makemessages
def _get_locale_dirs(resources):
"""
Return a tuple (app name, absolute path) for all locale directories.
If resources list is not None, filter directories matching resources content.
"""
contrib_dir = os.getcwd()
dirs = []
# Collect all locale directories
for contrib_name in os.listdir(contrib_dir):
path = os.path.join(contrib_dir, contrib_name, "locale")
if os.path.isdir(path):
dirs.append((contrib_name, path))
# Filter by resources, if any
if resources is not None:
res_names = [d[0] for d in dirs]
dirs = [ld for ld in dirs if ld[0] in resources]
if len(resources) > len(dirs):
print("You have specified some unknown resources. "
"Available resource names are: {0}".format(", ".join(res_names)))
exit(1)
return dirs
def _tx_resource_for_name(name):
""" Return the Transifex resource name """
return "taiga-back.{}".format(name)
def _check_diff(cat_name, base_path):
"""
Output the approximate number of changed/added strings in the en catalog.
"""
po_path = "{path}/en/LC_MESSAGES/django.po".format(path=base_path)
p = Popen("git diff -U0 {0} | egrep '^[-+]msgid' | wc -l".format(po_path),
stdout=PIPE, stderr=PIPE, shell=True)
output, errors = p.communicate()
num_changes = int(output.strip())
print("{0} changed/added messages in '{1}' catalog.".format(num_changes, cat_name))
def update_catalogs(resources=None, languages=None):
"""
Update the en/LC_MESSAGES/django.po (all) files with
new/updated translatable strings.
"""
cmd = makemessages.Command()
opts = {
"locale": ["en"],
"exclude": [],
"extensions": ["py", "jinja"],
# Default values
"domain": "django",
"all": False,
"symlinks": False,
"ignore_patterns": [],
"use_default_ignore_patterns": True,
"no_wrap": False,
"no_location": False,
"no_obsolete": False,
"keep_pot": False,
"verbosity": 0,
}
if resources is not None:
print("`update_catalogs` will always process all resources.")
os.chdir(os.getcwd())
print("Updating en catalogs for all taiga-back resourcess...")
cmd.handle(**opts)
# Output changed stats
contrib_dirs = _get_locale_dirs(None)
for name, dir_ in contrib_dirs:
_check_diff(name, dir_)
def lang_stats(resources=None, languages=None):
"""
Output language statistics of committed translation files for each catalog.
If resources is provided, it should be a list of translation resource to
limit the output (e.g. ['main', 'taiga']).
"""
locale_dirs = _get_locale_dirs(resources)
for name, dir_ in locale_dirs:
print("\nShowing translations stats for '{res}':".format(res=name))
langs = []
for d in os.listdir(dir_):
if not d.startswith('_') and os.path.isdir(os.path.join(dir_, d)):
langs.append(d)
langs = sorted(langs)
for lang in langs:
if languages and lang not in languages:
continue
# TODO: merge first with the latest en catalog
p = Popen("msgfmt -vc -o /dev/null {path}/{lang}/LC_MESSAGES/django.po".format(path=dir_, lang=lang),
stdout=PIPE, stderr=PIPE, shell=True)
output, errors = p.communicate()
if p.returncode == 0:
# msgfmt output stats on stderr
print("{0}: {1}".format(lang, errors.strip().decode("utf-8")))
else:
print("Errors happened when checking {0} translation for {1}:\n{2}".format(lang, name, errors))
def fetch(resources=None, languages=None):
"""
Fetch translations from Transifex, wrap long lines, generate mo files.
"""
locale_dirs = _get_locale_dirs(resources)
errors = []
for name, dir_ in locale_dirs:
# Transifex pull
if languages is None:
call("tx pull -r {res} -f --minimum-perc=5".format(res=_tx_resource_for_name(name)), shell=True)
languages = sorted([d for d in os.listdir(dir_) if not d.startswith("_") and os.path.isdir(os.path.join(dir_, d)) and d != "en"])
else:
for lang in languages:
call("tx pull -r {res} -f -l {lang}".format(res=_tx_resource_for_name(name), lang=lang), shell=True)
# msgcat to wrap lines and msgfmt for compilation of .mo file
for lang in languages:
po_path = "{path}/{lang}/LC_MESSAGES/django.po".format(path=dir_, lang=lang)
if not os.path.exists(po_path):
print("No {lang} translation for resource {res}".format(lang=lang, res=name))
continue
call("msgcat -o {0} {0}".format(po_path), shell=True)
res = call("msgfmt -c -o {0}.mo {1}".format(po_path[:-3], po_path), shell=True)
if res != 0:
errors.append((name, lang))
if errors:
print("\nWARNING: Errors have occurred in following cases:")
for resource, lang in errors:
print("\tResource {res} for language {lang}".format(res=resource, lang=lang))
exit(1)
def regenerate(resources=None, languages=None):
"""
Wrap long lines and generate mo files.
"""
locale_dirs = _get_locale_dirs(resources)
errors = []
for name, dir_ in locale_dirs:
if languages is None:
languages = sorted([d for d in os.listdir(dir_) if not d.startswith("_") and os.path.isdir(os.path.join(dir_, d)) and d != "en"])
for lang in languages:
po_path = "{path}/{lang}/LC_MESSAGES/django.po".format(path=dir_, lang=lang)
if not os.path.exists(po_path):
print("No {lang} translation for resource {res}".format(lang=lang, res=name))
continue
call("msgcat -o {0} {0}".format(po_path), shell=True)
res = call("msgfmt -c -o {0}.mo {1}".format(po_path[:-3], po_path), shell=True)
if res != 0:
errors.append((name, lang))
if errors:
print("\nWARNING: Errors have occurred in following cases:")
for resource, lang in errors:
print("\tResource {res} for language {lang}".format(res=resource, lang=lang))
exit(1)
def commit(resources=None, languages=None):
"""
Commit messages to Transifex,
"""
locale_dirs = _get_locale_dirs(resources)
errors = []
for name, dir_ in locale_dirs:
# Transifex push
if languages is None:
call("tx push -r {res} -s -l en".format(res=_tx_resource_for_name(name)), shell=True)
else:
for lang in languages:
call("tx push -r {res} -l {lang}".format(res= _tx_resource_for_name(name), lang=lang), shell=True)
if __name__ == "__main__":
try:
devnull = open(os.devnull)
Popen(["tx"], stdout=devnull, stderr=devnull).communicate()
except OSError as e:
if e.errno == os.errno.ENOENT:
print("""
You need transifex-client, install it.
1. Install transifex-client, use
$ pip install --upgrade transifex-client
2. Create ~/.transifexrc file:
$ vim ~/.transifexrc"
[https://www.transifex.com]
hostname = https://www.transifex.com
token =
username = <YOUR_USERNAME>
password = <YOUR_PASSWOR>
""")
exit(1)
RUNABLE_SCRIPTS = {
"update_catalogs": "regenerate .po files of main lang (en).",
"commit": "send .po file to transifex ('en' by default).",
"fetch": "get .po files from transifex and regenerate .mo files.",
"regenerate": "regenerate .mo files.",
"lang_stats": "get stats of local translations",
}
parser = ArgumentParser(description="manage translations in taiga-back between the repo and transifex.",
formatter_class=RawTextHelpFormatter)
parser.add_argument("cmd", nargs=1,
help="\n".join(["{0} - {1}".format(c, h) for c, h in RUNABLE_SCRIPTS.items()]))
parser.add_argument("-r", "--resources", action="append",
help="limit operation to the specified resources")
parser.add_argument("-l", "--languages", action="append",
help="limit operation to the specified languages")
options = parser.parse_args()
if options.cmd[0] in RUNABLE_SCRIPTS.keys():
eval(options.cmd[0])(options.resources, options.languages)
else:
print("Available commands are: {}".format(", ".join(RUNABLE_SCRIPTS.keys())))

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,19 +16,22 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from kombu import Exchange, Queue from kombu import Queue
BROKER_URL = 'amqp://guest:guest@localhost:5672//' broker_url = 'amqp://guest:guest@localhost:5672//'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0' result_backend = 'redis://localhost:6379/0'
CELERY_TIMEZONE = 'Europe/Madrid' accept_content = ['pickle',] # Values are 'pickle', 'json', 'msgpack' and 'yaml'
CELERY_ENABLE_UTC = True task_serializer = "pickle"
result_serializer = "pickle"
CELERY_DEFAULT_QUEUE = 'tasks' timezone = 'Europe/Madrid'
CELERY_QUEUES = (
task_default_queue = 'tasks'
task_queues = (
Queue('tasks', routing_key='task.#'), Queue('tasks', routing_key='task.#'),
Queue('transient', routing_key='transient.#', delivery_mode=1) Queue('transient', routing_key='transient.#', delivery_mode=1)
) )
CELERY_DEFAULT_EXCHANGE = 'tasks' task_default_exchange = 'tasks'
CELERY_DEFAULT_EXCHANGE_TYPE = 'topic' task_default_exchange_type = 'topic'
CELERY_DEFAULT_ROUTING_KEY = 'task.default' task_default_routing_key = 'task.default'

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -15,7 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path, sys, os import os.path, sys, os
from django.utils.translation import ugettext_lazy as _
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(__file__))
@ -26,14 +27,11 @@ ADMINS = (
("Admin", "example@example.com"), ("Admin", "example@example.com"),
) )
LANGUAGES = ( DEBUG = False
("en", _("English")),
("es", _("Spanish")),
)
DATABASES = { DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.postgresql_psycopg2", "ENGINE": "django.db.backends.postgresql",
"NAME": "taiga", "NAME": "taiga",
} }
} }
@ -60,12 +58,111 @@ IGNORABLE_404_STARTS = ("/phpmyadmin/",)
ATOMIC_REQUESTS = True ATOMIC_REQUESTS = True
TIME_ZONE = "UTC" TIME_ZONE = "UTC"
LANGUAGE_CODE = "en"
USE_I18N = True
USE_L10N = True
LOGIN_URL="/auth/login/" LOGIN_URL="/auth/login/"
USE_TZ = True USE_TZ = True
USE_I18N = True
USE_L10N = True
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
# Languages we provide translations for, out of the box.
LANGUAGES = [
#("af", "Afrikaans"), # Afrikaans
#("ar", "العربية‏"), # Arabic
#("ast", "Asturiano"), # Asturian
#("az", "Azərbaycan dili"), # Azerbaijani
#("bg", "Български"), # Bulgarian
#("be", "Беларуская"), # Belarusian
#("bn", "বাংলা"), # Bengali
#("br", "Bretón"), # Breton
#("bs", "Bosanski"), # Bosnian
("ca", "Català"), # Catalan
#("cs", "Čeština"), # Czech
#("cy", "Cymraeg"), # Welsh
#("da", "Dansk"), # Danish
("de", "Deutsch"), # German
#("el", "Ελληνικά"), # Greek
("en", "English (US)"), # English
#("en-au", "English (Australia)"), # Australian English
#("en-gb", "English (UK)"), # British English
#("eo", "esperanta"), # Esperanto
("es", "Español"), # Spanish
#("es-ar", "Español (Argentina)"), # Argentinian Spanish
#("es-mx", "Español (México)"), # Mexican Spanish
#("es-ni", "Español (Nicaragua)"), # Nicaraguan Spanish
#("es-ve", "Español (Venezuela)"), # Venezuelan Spanish
#("et", "Eesti"), # Estonian
#("eu", "Euskara"), # Basque
("fa", "فارسی‏"), # Persian
("fi", "Suomi"), # Finnish
("fr", "Français"), # French
#("fy", "Frysk"), # Frisian
#("ga", "Irish"), # Irish
#("gl", "Galego"), # Galician
#("he", "עברית‏"), # Hebrew
#("hi", "हिन्दी"), # Hindi
#("hr", "Hrvatski"), # Croatian
#("hu", "Magyar"), # Hungarian
#("ia", "Interlingua"), # Interlingua
#("id", "Bahasa Indonesia"), # Indonesian
#("io", "IDO"), # Ido
#("is", "Íslenska"), # Icelandic
("it", "Italiano"), # Italian
("ja", "日本語"), # Japanese
#("ka", "ქართული"), # Georgian
#("kk", "Қазақша"), # Kazakh
#("km", "ភាសាខ្មែរ"), # Khmer
#("kn", "ಕನ್ನಡ"), # Kannada
("ko", "한국어"), # Korean
#("lb", "Lëtzebuergesch"), # Luxembourgish
#("lt", "Lietuvių"), # Lithuanian
#("lv", "Latviešu"), # Latvian
#("mk", "Македонски"), # Macedonian
#("ml", "മലയാളം"), # Malayalam
#("mn", "Монгол"), # Mongolian
#("mr", "मराठी"), # Marathi
#("my", "မြန်မာ"), # Burmese
("nb", "Norsk (bokmål)"), # Norwegian Bokmal
#("ne", "नेपाली"), # Nepali
("nl", "Nederlands"), # Dutch
#("nn", "Norsk (nynorsk)"), # Norwegian Nynorsk
#("os", "Ирон æвзаг"), # Ossetic
#("pa", "ਪੰਜਾਬੀ"), # Punjabi
("pl", "Polski"), # Polish
#("pt", "Português (Portugal)"), # Portuguese
("pt-br", "Português (Brasil)"), # Brazilian Portuguese
#("ro", "Română"), # Romanian
("ru", "Русский"), # Russian
#("sk", "Slovenčina"), # Slovak
#("sl", "Slovenščina"), # Slovenian
#("sq", "Shqip"), # Albanian
#("sr", "Српски"), # Serbian
#("sr-latn", "srpski"), # Serbian Latin
("sv", "Svenska"), # Swedish
#("sw", "Kiswahili"), # Swahili
#("ta", "தமிழ்"), # Tamil
#("te", "తెలుగు"), # Telugu
#("th", "ภาษาไทย"), # Thai
("tr", "Türkçe"), # Turkish
#("tt", "татар теле"), # Tatar
#("udm", "удмурт кыл"), # Udmurt
("uk", "Українська"), # Ukrainian
#("ur", "اردو‏"), # Urdu
#("vi", "Tiếng Việt"), # Vietnamese
("zh-hans", "中文(简体)"), # Simplified Chinese
("zh-hant", "中文(香港)"), # Traditional Chinese
]
# Languages using BiDi (right-to-left) layout
LANGUAGES_BIDI = ["he", "ar", "fa", "ur"]
LOCALE_PATHS = (
os.path.join(BASE_DIR, "locale"),
os.path.join(BASE_DIR, "taiga", "locale"),
)
SITES = { SITES = {
"api": {"domain": "localhost:8000", "scheme": "http", "name": "api"}, "api": {"domain": "localhost:8000", "scheme": "http", "name": "api"},
"front": {"domain": "localhost:9001", "scheme": "http", "name": "front"}, "front": {"domain": "localhost:9001", "scheme": "http", "name": "front"},
@ -98,17 +195,12 @@ MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
# urls depends on it. On production should be set # urls depends on it. On production should be set
# something like https://media.taiga.io/ # something like https://media.taiga.io/
MEDIA_URL = "http://localhost:8000/media/" MEDIA_URL = "http://localhost:8000/media/"
# Static url is not widelly used by taiga (only
# if admin is activated).
STATIC_URL = "http://localhost:8000/static/" STATIC_URL = "http://localhost:8000/static/"
ADMIN_MEDIA_PREFIX = "http://localhost:8000/static/admin/"
# Static configuration. # Static configuration.
MEDIA_ROOT = os.path.join(BASE_DIR, "media") MEDIA_ROOT = os.path.join(BASE_DIR, "media")
STATIC_ROOT = os.path.join(BASE_DIR, "static") STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_FINDERS = [ STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder",
@ -119,22 +211,54 @@ STATICFILES_DIRS = (
# Don't forget to use absolute paths, not relative paths. # Don't forget to use absolute paths, not relative paths.
) )
# Default storage
# Defautl storage
DEFAULT_FILE_STORAGE = "taiga.base.storage.FileSystemStorage" DEFAULT_FILE_STORAGE = "taiga.base.storage.FileSystemStorage"
FILE_UPLOAD_PERMISSIONS = 0o644
LOCALE_PATHS = (
os.path.join(BASE_DIR, "locale"),
)
SECRET_KEY = "aw3+t2r(8(0kkrhg8)gx6i96v5^kv%6cfep9wxfom0%7dy0m9e" SECRET_KEY = "aw3+t2r(8(0kkrhg8)gx6i96v5^kv%6cfep9wxfom0%7dy0m9e"
TEMPLATE_LOADERS = [ TEMPLATES = [
"django_jinja.loaders.AppLoader", {
"django_jinja.loaders.FileSystemLoader", "BACKEND": "django_jinja.backend.Jinja2",
"DIRS": [
os.path.join(BASE_DIR, "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.request",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
],
"match_extension": ".jinja",
}
},
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.request",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
],
}
},
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE_CLASSES = [
"taiga.base.middleware.cors.CoorsMiddleware", "taiga.base.middleware.cors.CoorsMiddleware",
"taiga.events.middleware.SessionIDMiddleware", "taiga.events.middleware.SessionIDMiddleware",
@ -149,22 +273,9 @@ MIDDLEWARE_CLASSES = [
"django.contrib.messages.middleware.MessageMiddleware", "django.contrib.messages.middleware.MessageMiddleware",
] ]
TEMPLATE_CONTEXT_PROCESSORS = [
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.request",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
]
ROOT_URLCONF = "taiga.urls" ROOT_URLCONF = "taiga.urls"
TEMPLATE_DIRS = [
os.path.join(BASE_DIR, "templates"),
]
INSTALLED_APPS = [ INSTALLED_APPS = [
"django.contrib.auth", "django.contrib.auth",
"django.contrib.contenttypes", "django.contrib.contenttypes",
@ -172,33 +283,52 @@ INSTALLED_APPS = [
"django.contrib.messages", "django.contrib.messages",
"django.contrib.admin", "django.contrib.admin",
"django.contrib.staticfiles", "django.contrib.staticfiles",
"django.contrib.sitemaps",
"django.contrib.postgres",
"taiga.base", "taiga.base",
"taiga.base.api",
"taiga.locale",
"taiga.events", "taiga.events",
"taiga.front", "taiga.front",
"taiga.users", "taiga.users",
"taiga.userstorage", "taiga.userstorage",
"taiga.external_apps",
"taiga.projects", "taiga.projects",
"taiga.projects.references", "taiga.projects.references",
"taiga.projects.custom_attributes",
"taiga.projects.history", "taiga.projects.history",
"taiga.projects.notifications", "taiga.projects.notifications",
"taiga.projects.attachments", "taiga.projects.attachments",
"taiga.projects.likes",
"taiga.projects.votes", "taiga.projects.votes",
"taiga.projects.milestones", "taiga.projects.milestones",
"taiga.projects.epics",
"taiga.projects.userstories", "taiga.projects.userstories",
"taiga.projects.tasks", "taiga.projects.tasks",
"taiga.projects.issues", "taiga.projects.issues",
"taiga.projects.wiki", "taiga.projects.wiki",
"taiga.projects.contact",
"taiga.projects.settings",
"taiga.searches", "taiga.searches",
"taiga.timeline", "taiga.timeline",
"taiga.mdrender", "taiga.mdrender",
"taiga.export_import", "taiga.export_import",
"taiga.feedback", "taiga.feedback",
"taiga.stats",
"taiga.hooks.github",
"taiga.hooks.gitlab",
"taiga.hooks.bitbucket",
"taiga.hooks.gogs",
"taiga.webhooks",
"taiga.importers",
"rest_framework",
"djmail", "djmail",
"django_jinja", "django_jinja",
"django_jinja.contrib._humanize",
"sr",
"easy_thumbnails", "easy_thumbnails",
"raven.contrib.django.raven_compat",
] ]
WSGI_APPLICATION = "taiga.wsgi.application" WSGI_APPLICATION = "taiga.wsgi.application"
@ -221,11 +351,15 @@ LOGGING = {
"null": { "null": {
"format": "%(message)s", "format": "%(message)s",
}, },
"django.server": {
"()": "django.utils.log.ServerFormatter",
"format": "[%(server_time)s] %(message)s",
},
}, },
"handlers": { "handlers": {
"null": { "null": {
"level":"DEBUG", "level":"DEBUG",
"class":"django.utils.log.NullHandler", "class":"logging.NullHandler",
}, },
"console":{ "console":{
"level":"DEBUG", "level":"DEBUG",
@ -236,7 +370,12 @@ LOGGING = {
"level": "ERROR", "level": "ERROR",
"filters": ["require_debug_false"], "filters": ["require_debug_false"],
"class": "django.utils.log.AdminEmailHandler", "class": "django.utils.log.AdminEmailHandler",
} },
"django.server": {
"level": "INFO",
"class": "logging.StreamHandler",
"formatter": "django.server",
},
}, },
"loggers": { "loggers": {
"django": { "django": {
@ -249,10 +388,20 @@ LOGGING = {
"level": "ERROR", "level": "ERROR",
"propagate": False, "propagate": False,
}, },
"taiga.export_import": {
"handlers": ["mail_admins", "console"],
"level": "ERROR",
"propagate": False,
},
"taiga": { "taiga": {
"handlers": ["console"], "handlers": ["console"],
"level": "DEBUG", "level": "DEBUG",
"propagate": False, "propagate": False,
},
"django.server": {
"handlers": ["django.server"],
"level": "INFO",
"propagate": False,
} }
} }
} }
@ -260,6 +409,7 @@ LOGGING = {
AUTH_USER_MODEL = "users.User" AUTH_USER_MODEL = "users.User"
FORMAT_MODULE_PATH = "taiga.base.formats" FORMAT_MODULE_PATH = "taiga.base.formats"
DATE_INPUT_FORMATS = ( DATE_INPUT_FORMATS = (
"%Y-%m-%d", "%m/%d/%Y", "%d/%m/%Y", "%b %d %Y", "%Y-%m-%d", "%m/%d/%Y", "%d/%m/%Y", "%b %d %Y",
"%b %d, %Y", "%d %b %Y", "%d %b, %Y", "%B %d %Y", "%b %d, %Y", "%d %b %Y", "%d %b, %Y", "%B %d %Y",
@ -271,12 +421,8 @@ AUTHENTICATION_BACKENDS = (
"django.contrib.auth.backends.ModelBackend", # default "django.contrib.auth.backends.ModelBackend", # default
) )
ANONYMOUS_USER_ID = -1 MAX_AGE_AUTH_TOKEN = None
MAX_AGE_CANCEL_ACCOUNT = 30 * 24 * 60 * 60 # 30 days in seconds
MAX_SEARCH_RESULTS = 100
# FIXME: this seems not be used by any module
API_LIMIT_PER_PAGE = 0
REST_FRAMEWORK = { REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": ( "DEFAULT_AUTHENTICATION_CLASSES": (
@ -285,7 +431,27 @@ REST_FRAMEWORK = {
# Mainly used for api debug. # Mainly used for api debug.
"taiga.auth.backends.Session", "taiga.auth.backends.Session",
# Application tokens auth
"taiga.external_apps.auth_backends.Token",
), ),
"DEFAULT_THROTTLE_CLASSES": (
"taiga.base.throttling.CommonThrottle",
),
"DEFAULT_THROTTLE_RATES": {
"anon-write": None,
"user-write": None,
"anon-read": None,
"user-read": None,
"import-mode": None,
"import-dump-mode": "1/minute",
"create-memberships": None,
"login-fail": None,
"register-success": None,
"user-detail": None,
"user-update": None,
},
"DEFAULT_THROTTLE_WHITELIST": [],
"FILTER_BACKEND": "taiga.base.filters.FilterBackend", "FILTER_BACKEND": "taiga.base.filters.FilterBackend",
"EXCEPTION_HANDLER": "taiga.base.exceptions.exception_handler", "EXCEPTION_HANDLER": "taiga.base.exceptions.exception_handler",
"PAGINATE_BY": 30, "PAGINATE_BY": 30,
@ -294,8 +460,19 @@ REST_FRAMEWORK = {
"DATETIME_FORMAT": "%Y-%m-%dT%H:%M:%S%z" "DATETIME_FORMAT": "%Y-%m-%dT%H:%M:%S%z"
} }
# Extra expose header related to Taiga APP (see taiga.base.middleware.cors=)
APP_EXTRA_EXPOSE_HEADERS = [
"taiga-info-total-opened-milestones",
"taiga-info-total-closed-milestones",
"taiga-info-project-memberships",
"taiga-info-project-is-private",
"taiga-info-order-updated"
]
DEFAULT_PROJECT_TEMPLATE = "scrum" DEFAULT_PROJECT_TEMPLATE = "scrum"
PUBLIC_REGISTER_ENABLED = False PUBLIC_REGISTER_ENABLED = False
# None or [] values in USER_EMAIL_ALLOWED_DOMAINS means allow any domain
USER_EMAIL_ALLOWED_DOMAINS = None
SEARCHES_MAX_RESULTS = 150 SEARCHES_MAX_RESULTS = 150
@ -303,20 +480,36 @@ SOUTH_MIGRATION_MODULES = {
'easy_thumbnails': 'easy_thumbnails.south_migrations', 'easy_thumbnails': 'easy_thumbnails.south_migrations',
} }
DEFAULT_AVATAR_SIZE = 80 # 80x80 pixels
DEFAULT_BIG_AVATAR_SIZE = 300 # 300x300 pixels THN_AVATAR_SIZE = 80 # 80x80 pixels
THN_AVATAR_BIG_SIZE = 300 # 300x300 pixels
THN_LOGO_SMALL_SIZE = 80 # 80x80 pixels
THN_LOGO_BIG_SIZE = 300 # 300x300 pixels
THN_TIMELINE_IMAGE_SIZE = 640 # 640x??? pixels
THN_CARD_IMAGE_WIDTH = 300 # 300 pixels
THN_CARD_IMAGE_HEIGHT = 200 # 200 pixels
THN_PREVIEW_IMAGE_WIDTH = 800 # 800 pixels
THN_AVATAR_SMALL = "avatar"
THN_AVATAR_BIG = "big-avatar"
THN_LOGO_SMALL = "logo-small"
THN_LOGO_BIG = "logo-big"
THN_ATTACHMENT_TIMELINE = "timeline-image"
THN_ATTACHMENT_CARD = "card-image"
THN_ATTACHMENT_PREVIEW = "preview-image"
THUMBNAIL_ALIASES = { THUMBNAIL_ALIASES = {
'': { "": {
'avatar': {'size': (DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_SIZE), 'crop': True}, THN_AVATAR_SMALL: {"size": (THN_AVATAR_SIZE, THN_AVATAR_SIZE), "crop": True},
'big-avatar': {'size': (DEFAULT_BIG_AVATAR_SIZE, DEFAULT_BIG_AVATAR_SIZE), 'crop': True}, THN_AVATAR_BIG: {"size": (THN_AVATAR_BIG_SIZE, THN_AVATAR_BIG_SIZE), "crop": True},
THN_LOGO_SMALL: {"size": (THN_LOGO_SMALL_SIZE, THN_LOGO_SMALL_SIZE), "crop": True},
THN_LOGO_BIG: {"size": (THN_LOGO_BIG_SIZE, THN_LOGO_BIG_SIZE), "crop": True},
THN_ATTACHMENT_TIMELINE: {"size": (THN_TIMELINE_IMAGE_SIZE, 0), "crop": True},
THN_ATTACHMENT_CARD: {"size": (THN_CARD_IMAGE_WIDTH, THN_CARD_IMAGE_HEIGHT), "crop": True},
THN_ATTACHMENT_PREVIEW: {"size": (THN_PREVIEW_IMAGE_WIDTH, 0), "crop": False},
}, },
} }
# GRAVATAR_DEFAULT_AVATAR = "img/user-noimage.png"
GRAVATAR_DEFAULT_AVATAR = ""
GRAVATAR_AVATAR_SIZE = DEFAULT_AVATAR_SIZE
TAGS_PREDEFINED_COLORS = ["#fce94f", "#edd400", "#c4a000", "#8ae234", TAGS_PREDEFINED_COLORS = ["#fce94f", "#edd400", "#c4a000", "#8ae234",
"#73d216", "#4e9a06", "#d3d7cf", "#fcaf3e", "#73d216", "#4e9a06", "#d3d7cf", "#fcaf3e",
"#f57900", "#ce5c00", "#729fcf", "#3465a4", "#f57900", "#ce5c00", "#729fcf", "#3465a4",
@ -328,6 +521,75 @@ TAGS_PREDEFINED_COLORS = ["#fce94f", "#edd400", "#c4a000", "#8ae234",
FEEDBACK_ENABLED = True FEEDBACK_ENABLED = True
FEEDBACK_EMAIL = "support@taiga.io" FEEDBACK_EMAIL = "support@taiga.io"
# Stats module settings
STATS_ENABLED = False
STATS_CACHE_TIMEOUT = 60*60 # In second
# 0 notifications will work in a synchronous way
# >0 an external process will check the pending notifications and will send them
# collapsed during that interval
CHANGE_NOTIFICATIONS_MIN_INTERVAL = 0 #seconds
# List of functions called for filling correctly the ProjectModulesConfig associated to a project
# This functions should receive a Project parameter and return a dict with the desired configuration
PROJECT_MODULES_CONFIGURATORS = {
"github": "taiga.hooks.github.services.get_or_generate_config",
"gitlab": "taiga.hooks.gitlab.services.get_or_generate_config",
"bitbucket": "taiga.hooks.bitbucket.services.get_or_generate_config",
"gogs": "taiga.hooks.gogs.services.get_or_generate_config",
}
BITBUCKET_VALID_ORIGIN_IPS = ["131.103.20.165", "131.103.20.166", "104.192.143.192/28", "104.192.143.208/28"]
GITLAB_VALID_ORIGIN_IPS = []
EXPORTS_TTL = 60 * 60 * 24 # 24 hours
CELERY_ENABLED = False
WEBHOOKS_ENABLED = False
WEBHOOKS_BLOCK_PRIVATE_ADDRESS = False
# If is True /front/sitemap.xml show a valid sitemap of taiga-front client
FRONT_SITEMAP_ENABLED = False
FRONT_SITEMAP_CACHE_TIMEOUT = 24*60*60 # In second
EXTRA_BLOCKING_CODES = []
MAX_PRIVATE_PROJECTS_PER_USER = None # None == no limit
MAX_PUBLIC_PROJECTS_PER_USER = None # None == no limit
MAX_MEMBERSHIPS_PRIVATE_PROJECTS = None # None == no limit
MAX_MEMBERSHIPS_PUBLIC_PROJECTS = None # None == no limit
MAX_PENDING_MEMBERSHIPS = 30 # Max number of unconfirmed memberships in a project
from .sr import *
IMPORTERS = {
"github": {
"active": False,
"client_id": "",
"client_secret": "",
},
"trello": {
"active": False,
"api_key": "",
"secret_key": "",
},
"jira": {
"active": False,
"consumer_key": "",
"cert": "",
"pub_cert": "",
},
"asana": {
"active": False,
"callback_url": "",
"app_id": "",
"app_secret": "",
}
}
# NOTE: DON'T INSERT MORE SETTINGS AFTER THIS LINE # NOTE: DON'T INSERT MORE SETTINGS AFTER THIS LINE
TEST_RUNNER="django.test.runner.DiscoverRunner" TEST_RUNNER="django.test.runner.DiscoverRunner"

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -17,8 +19,5 @@
from .common import * from .common import *
DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG
TEMPLATE_CONTEXT_PROCESSORS += [ TEMPLATES[0]["OPTIONS"]['context_processors'] += "django.template.context_processors.debug"
"django.core.context_processors.debug",
]

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -16,36 +18,110 @@
from .development import * from .development import *
#DATABASES = { #########################################
# 'default': { ## GENERIC
# 'ENGINE': 'django.db.backends.postgresql_psycopg2', #########################################
# 'NAME': 'taiga',
# 'USER': 'taiga', #DEBUG = False
# 'PASSWORD': '',
# 'HOST': '', #ADMINS = (
# 'PORT': '', # ("Admin", "example@example.com"),
# } #)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'taiga',
'USER': 'taiga',
'PASSWORD': 'changeme',
'HOST': '',
'PORT': '',
}
}
#SITES = {
# "api": {
# "scheme": "http",
# "domain": "localhost:8000",
# "name": "api"
# },
# "front": {
# "scheme": "http",
# "domain": "localhost:9001",
# "name": "front"
# },
#} #}
#
#HOST="http://taiga.projects.kaleidos.net" #SITE_ID = "api"
#
#MEDIA_ROOT = '/home/taiga/media' #MEDIA_ROOT = '/home/taiga/media'
#STATIC_ROOT = '/home/taiga/static' #STATIC_ROOT = '/home/taiga/static'
#########################################
## THROTTLING
#########################################
#REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = {
# "anon-write": "20/min",
# "user-write": None,
# "anon-read": None,
# "user-read": None,
# "import-mode": None,
# "import-dump-mode": "1/minute",
# "create-memberships": None,
# "login-fail": None,
# "register-success": None,
# "user-detail": None,
# "user-update": None,
#}
# This list should containt:
# - Tiga users IDs
# - Valid clients IP addresses (X-Forwarded-For header)
#REST_FRAMEWORK["DEFAULT_THROTTLE_WHITELIST"] = []
#########################################
## MAIL SYSTEM SETTINGS
#########################################
#DEFAULT_FROM_EMAIL = "john@doe.com"
#CHANGE_NOTIFICATIONS_MIN_INTERVAL = 300 #seconds
# EMAIL SETTINGS EXAMPLE
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#EMAIL_USE_TLS = False #EMAIL_USE_TLS = False
#EMAIL_USE_SSL = False # You cannot use both (TLS and SSL) at the same time!
#EMAIL_HOST = 'localhost' #EMAIL_HOST = 'localhost'
#EMAIL_PORT = 25
#EMAIL_HOST_USER = 'user' #EMAIL_HOST_USER = 'user'
#EMAIL_HOST_PASSWORD = 'password' #EMAIL_HOST_PASSWORD = 'password'
#EMAIL_PORT = 25
#DEFAULT_FROM_EMAIL = "john@doe.com"
# GMAIL SETTINGS EXAMPLE # GMAIL SETTINGS EXAMPLE
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' #EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#EMAIL_USE_TLS = True #EMAIL_USE_TLS = True
#EMAIL_HOST = 'smtp.gmail.com' #EMAIL_HOST = 'smtp.gmail.com'
#EMAIL_PORT = 587
#EMAIL_HOST_USER = 'youremail@gmail.com' #EMAIL_HOST_USER = 'youremail@gmail.com'
#EMAIL_HOST_PASSWORD = 'yourpassword' #EMAIL_HOST_PASSWORD = 'yourpassword'
#EMAIL_PORT = 587
#########################################
## REGISTRATION
#########################################
#PUBLIC_REGISTER_ENABLED = True
# LIMIT ALLOWED DOMAINS FOR REGISTER AND INVITE
# None or [] values in USER_EMAIL_ALLOWED_DOMAINS means allow any domain
#USER_EMAIL_ALLOWED_DOMAINS = None
# PUCLIC OR PRIVATE NUMBER OF PROJECT PER USER
#MAX_PRIVATE_PROJECTS_PER_USER = None # None == no limit
#MAX_PUBLIC_PROJECTS_PER_USER = None # None == no limit
#MAX_MEMBERSHIPS_PRIVATE_PROJECTS = None # None == no limit
#MAX_MEMBERSHIPS_PUBLIC_PROJECTS = None # None == no limit
# GITHUB SETTINGS # GITHUB SETTINGS
#GITHUB_URL = "https://github.com/" #GITHUB_URL = "https://github.com/"
@ -53,3 +129,77 @@ from .development import *
#GITHUB_API_CLIENT_ID = "yourgithubclientid" #GITHUB_API_CLIENT_ID = "yourgithubclientid"
#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret" #GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"
#########################################
## SITEMAP
#########################################
# If is True /front/sitemap.xml show a valid sitemap of taiga-front client
#FRONT_SITEMAP_ENABLED = False
#FRONT_SITEMAP_CACHE_TIMEOUT = 24*60*60 # In second
#########################################
## FEEDBACK
#########################################
# Note: See config in taiga-front too
#FEEDBACK_ENABLED = True
#FEEDBACK_EMAIL = "support@taiga.io"
#########################################
## STATS
#########################################
#STATS_ENABLED = False
#FRONT_SITEMAP_CACHE_TIMEOUT = 60*60 # In second
#########################################
## CELERY
#########################################
# Set to True to enable celery and work in async mode or False
# to disable it and work in sync mode. You can find the celery
# settings in settings/celery.py and settings/celery-local.py
#CELERY_ENABLED = True
#########################################
## IMPORTERS
#########################################
# Configuration for the GitHub importer
# Remember to enable it in the front client too.
#IMPORTERS["github"] = {
# "active": True, # Enable or disable the importer
# "client_id": "XXXXXX_get_a_valid_client_id_from_github_XXXXXX",
# "client_secret": "XXXXXX_get_a_valid_client_secret_from_github_XXXXXX"
#}
# Configuration for the Trello importer
# Remember to enable it in the front client too.
#IMPORTERS["trello"] = {
# "active": True, # Enable or disable the importer
# "api_key": "XXXXXX_get_a_valid_api_key_from_trello_XXXXXX",
# "secret_key": "XXXXXX_get_a_valid_secret_key_from_trello_XXXXXX"
#}
# Configuration for the Jira importer
# Remember to enable it in the front client too.
#IMPORTERS["jira"] = {
# "active": True, # Enable or disable the importer
# "consumer_key": "XXXXXX_get_a_valid_consumer_key_from_jira_XXXXXX",
# "cert": "XXXXXX_get_a_valid_cert_from_jira_XXXXXX",
# "pub_cert": "XXXXXX_get_a_valid_pub_cert_from_jira_XXXXXX"
#}
# Configuration for the Asane importer
# Remember to enable it in the front client too.
#IMPORTERS["asana"] = {
# "active": True, # Enable or disable the importer
# "callback_url": "{}://{}/project/new/import/asana".format(SITES["front"]["scheme"],
# SITES["front"]["domain"]),
# "app_id": "XXXXXX_get_a_valid_app_id_from_asana_XXXXXX",
# "app_secret": "XXXXXX_get_a_valid_app_secret_from_asana_XXXXXX"
#}

31
settings/sr.py Normal file
View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SR = {
"taigaio_url": "https://taiga.io",
"social": {
"twitter_url": "https://twitter.com/taigaio",
"github_url": "https://github.com/taigaio",
},
"support": {
"url": "https://tree.taiga.io/support",
"email": "support@taiga.io",
"mailing_list": "https://groups.google.com/forum/#!forum/taigaio",
}
}

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -16,11 +18,31 @@
from .development import * from .development import *
SKIP_SOUTH_TESTS = True CELERY_ENABLED = False
SOUTH_TESTS_MIGRATE = False
CELERY_ALWAYS_EAGER = True
MEDIA_ROOT = "/tmp" MEDIA_ROOT = "/tmp"
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
INSTALLED_APPS = INSTALLED_APPS + ["tests"] INSTALLED_APPS = INSTALLED_APPS + [
"tests",
]
REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = {
"anon-write": None,
"anon-read": None,
"user-write": None,
"user-read": None,
"import-mode": None,
"import-dump-mode": None,
"create-memberships": None,
"login-fail": None,
"register-success": None,
"user-detail": None,
"user-update": None,
}
IMPORTERS['github']['active'] = True
IMPORTERS['jira']['active'] = True
IMPORTERS['asana']['active'] = True
IMPORTERS['trello']['active'] = True

14
setup.cfg Normal file
View File

@ -0,0 +1,14 @@
[flake8]
ignore = E41,E266
max-line-length = 120
exclude =
.cache,
.git,
.tox,
.venv,
*__pycache__*,
*tests*,
*scripts*,
*migrations*,
*management*
max-complexity = 10

View File

@ -1 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import celery from . import celery

View File

@ -1 +0,0 @@

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -15,38 +17,32 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from functools import partial from functools import partial
from enum import Enum
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext as _
from django.conf import settings from django.conf import settings
from rest_framework.response import Response
from rest_framework import status
from rest_framework import serializers
from taiga.base.api import viewsets from taiga.base.api import viewsets
from taiga.base.decorators import list_route from taiga.base.decorators import list_route
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.base.connectors import github from taiga.base import response
from taiga.users.services import get_and_validate_user
from .serializers import PublicRegisterSerializer from .validators import PublicRegisterValidator
from .serializers import PrivateRegisterForExistingUserSerializer from .validators import PrivateRegisterValidator
from .serializers import PrivateRegisterForNewUserSerializer
from .services import private_register_for_existing_user
from .services import private_register_for_new_user from .services import private_register_for_new_user
from .services import public_register from .services import public_register
from .services import github_register
from .services import make_auth_response_data from .services import make_auth_response_data
from .services import get_auth_plugins
from .services import accept_invitation_by_existing_user
from .permissions import AuthPermission from .permissions import AuthPermission
from .throttling import LoginFailRateThrottle, RegisterSuccessRateThrottle
def _parse_data(data:dict, *, cls): def _parse_data(data:dict, *, cls):
""" """
Generic function for parse user data using Generic function for parse user data using
specified serializer on `cls` keyword parameter. specified validator on `cls` keyword parameter.
Raises: RequestValidationError exception if Raises: RequestValidationError exception if
some errors found when data is validated. some errors found when data is validated.
@ -54,49 +50,21 @@ def _parse_data(data:dict, *, cls):
Returns the parsed data. Returns the parsed data.
""" """
serializer = cls(data=data) validator = cls(data=data)
if not serializer.is_valid(): if not validator.is_valid():
raise exc.RequestValidationError(serializer.errors) raise exc.RequestValidationError(validator.errors)
return serializer.data return validator.data
# Parse public register data # Parse public register data
parse_public_register_data = partial(_parse_data, cls=PublicRegisterSerializer) parse_public_register_data = partial(_parse_data, cls=PublicRegisterValidator)
# Parse private register data for existing user
parse_private_register_for_existing_user_data = \
partial(_parse_data, cls=PrivateRegisterForExistingUserSerializer)
# Parse private register data for new user # Parse private register data for new user
parse_private_register_for_new_user_data = \ parse_private_register_data = partial(_parse_data, cls=PrivateRegisterValidator)
partial(_parse_data, cls=PrivateRegisterForNewUserSerializer)
class RegisterTypeEnum(Enum):
new_user = 1
existing_user = 2
def parse_register_type(userdata:dict) -> str:
"""
Parses user data and detects that register type is.
It returns RegisterTypeEnum value.
"""
# Create adhoc inner serializer for avoid parse
# manually the user data.
class _serializer(serializers.Serializer):
existing = serializers.BooleanField()
instance = _serializer(data=userdata)
if not instance.is_valid():
raise exc.RequestValidationError(instance.errors)
if instance.data["existing"]:
return RegisterTypeEnum.existing_user
return RegisterTypeEnum.new_user
class AuthViewSet(viewsets.ViewSet): class AuthViewSet(viewsets.ViewSet):
permission_classes = (AuthPermission,) permission_classes = (AuthPermission,)
throttle_classes = (LoginFailRateThrottle, RegisterSuccessRateThrottle)
def _public_register(self, request): def _public_register(self, request):
if not settings.PUBLIC_REGISTER_ENABLED: if not settings.PUBLIC_REGISTER_ENABLED:
@ -109,23 +77,21 @@ class AuthViewSet(viewsets.ViewSet):
raise exc.BadRequest(e.detail) raise exc.BadRequest(e.detail)
data = make_auth_response_data(user) data = make_auth_response_data(user)
return Response(data, status=status.HTTP_201_CREATED) return response.Created(data)
def _private_register(self, request): def _private_register(self, request):
register_type = parse_register_type(request.DATA) data = parse_private_register_data(request.DATA)
user = private_register_for_new_user(**data)
if register_type is RegisterTypeEnum.existing_user:
data = parse_private_register_for_existing_user_data(request.DATA)
user = private_register_for_existing_user(**data)
else:
data = parse_private_register_for_new_user_data(request.DATA)
user = private_register_for_new_user(**data)
data = make_auth_response_data(user) data = make_auth_response_data(user)
return Response(data, status=status.HTTP_201_CREATED) return response.Created(data)
@list_route(methods=["POST"]) @list_route(methods=["POST"])
def register(self, request, **kwargs): def register(self, request, **kwargs):
accepted_terms = request.DATA.get("accepted_terms", None)
if accepted_terms in (None, False):
raise exc.BadRequest(_("You must accept our terms of service and privacy policy"))
self.check_permissions(request, 'register', None) self.check_permissions(request, 'register', None)
type = request.DATA.get("type", None) type = request.DATA.get("type", None)
@ -135,36 +101,18 @@ class AuthViewSet(viewsets.ViewSet):
return self._private_register(request) return self._private_register(request)
raise exc.BadRequest(_("invalid register type")) raise exc.BadRequest(_("invalid register type"))
def _login(self, request):
username = request.DATA.get('username', None)
password = request.DATA.get('password', None)
user = get_and_validate_user(username=username, password=password)
data = make_auth_response_data(user)
return Response(data, status=status.HTTP_200_OK)
def _github_login(self, request):
code = request.DATA.get('code', None)
token = request.DATA.get('token', None)
email, user_info = github.me(code)
user = github_register(username=user_info.username,
email=email,
full_name=user_info.full_name,
github_id=user_info.id,
bio=user_info.bio,
token=token)
data = make_auth_response_data(user)
return Response(data, status=status.HTTP_200_OK)
# Login view: /api/v1/auth # Login view: /api/v1/auth
def create(self, request, **kwargs): def create(self, request, **kwargs):
self.check_permissions(request, 'create', None) self.check_permissions(request, 'create', None)
auth_plugins = get_auth_plugins()
login_type = request.DATA.get("type", None)
invitation_token = request.DATA.get("invitation_token", None)
if login_type in auth_plugins:
data = auth_plugins[login_type]['login_func'](request)
if invitation_token:
accept_invitation_by_existing_user(invitation_token, data['id'])
return response.Ok(data)
type = request.DATA.get("type", None)
if type == "normal":
return self._login(request)
elif type == "github":
return self._github_login(request)
raise exc.BadRequest(_("invalid login type")) raise exc.BadRequest(_("invalid login type"))

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -32,19 +34,20 @@ selfcontained tokens. This trust tokes from external
fraudulent modifications. fraudulent modifications.
""" """
import base64
import re import re
from django.core import signing from django.conf import settings
from django.apps import apps from django.utils import timezone
from rest_framework.authentication import BaseAuthentication from datetime import timedelta
from taiga.base import exceptions as exc from taiga.base.api.authentication import BaseAuthentication
from .tokens import get_user_for_token
class Session(BaseAuthentication): class Session(BaseAuthentication):
""" """
Session based authentication like the standard Session based authentication like the standard
`rest_framework.authentication.SessionAuthentication` `taiga.base.api.authentication.SessionAuthentication`
but with csrf disabled (for obvious reasons because but with csrf disabled (for obvious reasons because
it is for api. it is for api.
@ -62,39 +65,6 @@ class Session(BaseAuthentication):
return (user, None) return (user, None)
def get_token_for_user(user):
"""
Generate a new signed token containing
a specified user.
"""
data = {"user_id": user.id}
return signing.dumps(data)
def get_user_for_token(token):
"""
Given a selfcontained token, try parse and
unsign it.
If token passes a validation, returns
a user instance corresponding with user_id stored
in the incoming token.
"""
try:
data = signing.loads(token)
except signing.BadSignature:
raise exc.NotAuthenticated("Invalid token")
model_cls = apps.get_model("users", "User")
try:
user = model_cls.objects.get(pk=data["user_id"])
except model_cls.DoesNotExist:
raise exc.NotAuthenticated("Invalid token")
else:
return user
class Token(BaseAuthentication): class Token(BaseAuthentication):
""" """
Self-contained stateles authentication implementatrion Self-contained stateles authentication implementatrion
@ -114,7 +84,14 @@ class Token(BaseAuthentication):
return None return None
token = token_rx_match.group(1) token = token_rx_match.group(1)
user = get_user_for_token(token) max_age_auth_token = getattr(settings, "MAX_AGE_AUTH_TOKEN", None)
user = get_user_for_token(token, "authentication",
max_age=max_age_auth_token)
if user.last_login is None or user.last_login < (timezone.now() - timedelta(minutes=1)):
user.last_login = timezone.now()
user.save(update_fields=["last_login"])
return (user, token) return (user, token)
def authenticate_header(self, request): def authenticate_header(self, request):

View File

@ -1,5 +1,7 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # -*- coding: utf-8 -*-
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -24,46 +26,44 @@ not uses clasess and uses simple functions.
""" """
from django.apps import apps from django.apps import apps
from django.db.models import Q from django.contrib.auth import get_user_model
from django.db import transaction as tx from django.db import transaction as tx
from django.db import IntegrityError from django.db import IntegrityError
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from djmail.template_mail import MagicMailBuilder
from taiga.base import exceptions as exc from taiga.base import exceptions as exc
from taiga.users.serializers import UserSerializer from taiga.base.mails import mail_builder
from taiga.users.serializers import UserAdminSerializer
from taiga.users.services import get_and_validate_user from taiga.users.services import get_and_validate_user
from .backends import get_token_for_user from .tokens import get_token_for_user
from .signals import user_registered as user_registered_signal
auth_plugins = {}
def send_public_register_email(user) -> bool: def register_auth_plugin(name, login_func):
auth_plugins[name] = {
"login_func": login_func,
}
def get_auth_plugins():
return auth_plugins
def send_register_email(user) -> bool:
""" """
Given a user, send public register welcome email Given a user, send register welcome email
message to specified user. message to specified user.
""" """
cancel_token = get_token_for_user(user, "cancel_account")
context = {"user": user} context = {"user": user, "cancel_token": cancel_token}
mbuilder = MagicMailBuilder() email = mail_builder.registered_user(user, context)
email = mbuilder.public_register_user(user.email, context)
return bool(email.send()) return bool(email.send())
def send_private_register_email(user, **kwargs) -> bool: def is_user_already_registered(*, username:str, email:str) -> (bool, str):
"""
Given a user, send private register welcome
email message to specified user.
"""
context = {"user": user}
context.update(kwargs)
mbuilder = MagicMailBuilder()
email = mbuilder.private_register_user(user.email, context)
return bool(email.send())
def is_user_already_registered(*, username:str, email:str, github_id:int=None) -> (bool, str):
""" """
Checks if a specified user is already registred. Checks if a specified user is already registred.
@ -71,16 +71,13 @@ def is_user_already_registered(*, username:str, email:str, github_id:int=None) -
and in case he does whats the duplicated attribute and in case he does whats the duplicated attribute
""" """
user_model = apps.get_model("users", "User") user_model = get_user_model()
if user_model.objects.filter(username=username): if user_model.objects.filter(username=username):
return (True, _("Username is already in use.")) return (True, _("Username is already in use."))
if user_model.objects.filter(email=email): if user_model.objects.filter(email=email):
return (True, _("Email is already in use.")) return (True, _("Email is already in use."))
if github_id and user_model.objects.filter(github_id=github_id):
return (True, _("Github id is already in use"))
return (False, None) return (False, None)
@ -95,7 +92,7 @@ def get_membership_by_token(token:str):
membership_model = apps.get_model("projects", "Membership") membership_model = apps.get_model("projects", "Membership")
qs = membership_model.objects.filter(token=token) qs = membership_model.objects.filter(token=token)
if len(qs) == 0: if len(qs) == 0:
raise exc.NotFound("Token not matches any valid invitation.") raise exc.NotFound(_("Token not matches any valid invitation."))
return qs[0] return qs[0]
@ -115,40 +112,33 @@ def public_register(username:str, password:str, email:str, full_name:str):
if is_registered: if is_registered:
raise exc.WrongArguments(reason) raise exc.WrongArguments(reason)
user_model = apps.get_model("users", "User") user_model = get_user_model()
user = user_model(username=username, user = user_model(username=username,
email=email, email=email,
full_name=full_name) full_name=full_name,
read_new_terms=True)
user.set_password(password) user.set_password(password)
try: try:
user.save() user.save()
except IntegrityError: except IntegrityError:
raise exc.WrongArguments("User is already register.") raise exc.WrongArguments(_("User is already registered."))
# send_public_register_email(user) send_register_email(user)
user_registered_signal.send(sender=user.__class__, user=user)
return user return user
@tx.atomic @tx.atomic
def private_register_for_existing_user(token:str, username:str, password:str): def accept_invitation_by_existing_user(token:str, user_id:int):
""" user_model = get_user_model()
Register works not only for register users, also serves for accept user = user_model.objects.get(id=user_id)
inviatations for projects as existing user.
Given a invitation token with parsed parameters, accept inviation
as existing user.
"""
user = get_and_validate_user(username=username, password=password)
membership = get_membership_by_token(token) membership = get_membership_by_token(token)
try: try:
membership.user = user membership.user = user
membership.save(update_fields=["user"]) membership.save(update_fields=["user"])
except IntegrityError: except IntegrityError:
raise exc.IntegrityError("Membership with user is already exists.") raise exc.IntegrityError(_("This user is already a member of the project."))
# send_private_register_email(user)
return user return user
@ -163,7 +153,7 @@ def private_register_for_new_user(token:str, username:str, email:str,
if is_registered: if is_registered:
raise exc.WrongArguments(reason) raise exc.WrongArguments(reason)
user_model = apps.get_model("users", "User") user_model = get_user_model()
user = user_model(username=username, user = user_model(username=username,
email=email, email=email,
full_name=full_name) full_name=full_name)
@ -177,30 +167,8 @@ def private_register_for_new_user(token:str, username:str, email:str,
membership = get_membership_by_token(token) membership = get_membership_by_token(token)
membership.user = user membership.user = user
membership.save(update_fields=["user"]) membership.save(update_fields=["user"])
send_register_email(user)
return user user_registered_signal.send(sender=user.__class__, user=user)
@tx.atomic
def github_register(username:str, email:str, full_name:str, github_id:int, bio:str, token:str=None):
"""
Register a new user from github.
This can raise `exc.IntegrityError` exceptions in
case of conflics found.
:returns: User
"""
user_model = apps.get_model("users", "User")
user, created = user_model.objects.get_or_create(github_id=github_id,
defaults={"username": username,
"email": email,
"full_name": full_name,
"bio": bio})
if token:
membership = get_membership_by_token(token)
membership.user = user
membership.save(update_fields=["user"])
return user return user
@ -211,7 +179,19 @@ def make_auth_response_data(user) -> dict:
using python dict containing a representation using python dict containing a representation
of the logged user. of the logged user.
""" """
serializer = UserSerializer(user) serializer = UserAdminSerializer(user)
data = dict(serializer.data) data = dict(serializer.data)
data["auth_token"] = get_token_for_user(user) data["auth_token"] = get_token_for_user(user, "authentication")
return data return data
def normal_login_func(request):
username = request.DATA.get('username', None)
password = request.DATA.get('password', None)
user = get_and_validate_user(username=username, password=password)
data = make_auth_response_data(user)
return data
register_auth_plugin("normal", normal_login_func)

22
taiga/auth/signals.py Normal file
View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import django.dispatch
user_registered = django.dispatch.Signal(providing_args=["user"])

46
taiga/auth/throttling.py Normal file
View File

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from taiga.base import throttling
class LoginFailRateThrottle(throttling.GlobalThrottlingMixin, throttling.ThrottleByActionMixin, throttling.SimpleRateThrottle):
scope = "login-fail"
throttled_actions = ["create"]
def throttle_success(self, request, view):
return True
def finalize(self, request, response, view):
if response.status_code == 400:
self.history.insert(0, self.now)
self.cache.set(self.key, self.history, self.duration)
class RegisterSuccessRateThrottle(throttling.GlobalThrottlingMixin, throttling.ThrottleByActionMixin, throttling.SimpleRateThrottle):
scope = "register-success"
throttled_actions = ["register"]
def throttle_success(self, request, view):
return True
def finalize(self, request, response, view):
if response.status_code == 201:
self.history.insert(0, self.now)
self.cache.set(self.key, self.history, self.duration)

58
taiga/auth/tokens.py Normal file
View File

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.contrib.auth import get_user_model
from taiga.base import exceptions as exc
from django.apps import apps
from django.core import signing
from django.utils.translation import ugettext as _
def get_token_for_user(user, scope):
"""
Generate a new signed token containing
a specified user limited for a scope (identified as a string).
"""
data = {"user_%s_id" % (scope): user.id}
return signing.dumps(data)
def get_user_for_token(token, scope, max_age=None):
"""
Given a selfcontained token and a scope try to parse and
unsign it.
If max_age is specified it checks token expiration.
If token passes a validation, returns
a user instance corresponding with user_id stored
in the incoming token.
"""
try:
data = signing.loads(token, max_age=max_age)
except signing.BadSignature:
raise exc.NotAuthenticated(_("Invalid token"))
model_cls = get_user_model()
try:
user = model_cls.objects.get(pk=data["user_%s_id" % (scope)])
except (model_cls.DoesNotExist, KeyError):
raise exc.NotAuthenticated(_("Invalid token"))
else:
return user

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,14 +16,17 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from rest_framework import serializers from django.core import validators as core_validators
from django.utils.translation import ugettext as _
from taiga.base.api import serializers
from taiga.base.api import validators
from taiga.base.exceptions import ValidationError
from django.core import validators
from django.core.exceptions import ValidationError
import re import re
class BaseRegisterSerializer(serializers.Serializer): class BaseRegisterValidator(validators.Validator):
full_name = serializers.CharField(max_length=256) full_name = serializers.CharField(max_length=256)
email = serializers.EmailField(max_length=255) email = serializers.EmailField(max_length=255)
username = serializers.CharField(max_length=255) username = serializers.CharField(max_length=255)
@ -29,25 +34,19 @@ class BaseRegisterSerializer(serializers.Serializer):
def validate_username(self, attrs, source): def validate_username(self, attrs, source):
value = attrs[source] value = attrs[source]
validator = validators.RegexValidator(re.compile('^[\w.-]+$'), "invalid username", "invalid") validator = core_validators.RegexValidator(re.compile('^[\w.-]+$'), _("invalid username"), "invalid")
try: try:
validator(value) validator(value)
except ValidationError: except ValidationError:
raise serializers.ValidationError("Required. 255 characters or fewer. Letters, numbers " raise ValidationError(_("Required. 255 characters or fewer. Letters, numbers "
"and /./-/_ characters'") "and /./-/_ characters'"))
return attrs return attrs
class PublicRegisterSerializer(BaseRegisterSerializer): class PublicRegisterValidator(BaseRegisterValidator):
pass pass
class PrivateRegisterForNewUserSerializer(BaseRegisterSerializer): class PrivateRegisterValidator(BaseRegisterValidator):
token = serializers.CharField(max_length=255, required=True)
class PrivateRegisterForExistingUserSerializer(serializers.Serializer):
username = serializers.CharField(max_length=30)
password = serializers.CharField(min_length=4)
token = serializers.CharField(max_length=255, required=True) token = serializers.CharField(max_length=255, required=True)

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,15 +16,51 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This code is partially taken from django-rest-framework: # The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie # Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
VERSION = "2.3.13-taiga" # Based on django-resframework 2.3.13
# Header encoding (see RFC5987)
HTTP_HEADER_ENCODING = 'iso-8859-1'
# Default datetime input and output formats
ISO_8601 = 'iso-8601'
from .viewsets import ModelListViewSet from .viewsets import ModelListViewSet
from .viewsets import ModelCrudViewSet from .viewsets import ModelCrudViewSet
from .viewsets import ModelUpdateRetrieveViewSet
from .viewsets import GenericViewSet from .viewsets import GenericViewSet
from .viewsets import ReadOnlyListViewSet from .viewsets import ReadOnlyListViewSet
from .viewsets import ModelRetrieveViewSet
__all__ = ["ModelCrudViewSet", __all__ = ["ModelCrudViewSet",
"ModelListViewSet", "ModelListViewSet",
"ModelUpdateRetrieveViewSet",
"GenericViewSet", "GenericViewSet",
"ReadOnlyListViewSet"] "ReadOnlyListViewSet",
"ModelRetrieveViewSet"]

View File

@ -0,0 +1,173 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Provides various authentication policies.
"""
import base64
from django.contrib.auth import authenticate
from django.middleware.csrf import CsrfViewMiddleware
from taiga.base import exceptions
from . import HTTP_HEADER_ENCODING
def get_authorization_header(request):
"""
Return request's 'Authorization:' header, as a bytestring.
Hide some test client ickyness where the header can be unicode.
"""
auth = request.META.get('HTTP_AUTHORIZATION', b'')
if type(auth) == type(''):
# Work around django test client oddness
auth = auth.encode(HTTP_HEADER_ENCODING)
return auth
class CSRFCheck(CsrfViewMiddleware):
def _reject(self, request, reason):
# Return the failure reason instead of an HttpResponse
return reason
class BaseAuthentication(object):
"""
All authentication classes should extend BaseAuthentication.
"""
def authenticate(self, request):
"""
Authenticate the request and return a two-tuple of (user, token).
"""
raise NotImplementedError(".authenticate() must be overridden.")
def authenticate_header(self, request):
"""
Return a string to be used as the value of the `WWW-Authenticate`
header in a `401 Unauthenticated` response, or `None` if the
authentication scheme should return `403 Permission Denied` responses.
"""
pass
class BasicAuthentication(BaseAuthentication):
"""
HTTP Basic authentication against username/password.
"""
www_authenticate_realm = 'api'
def authenticate(self, request):
"""
Returns a `User` if a correct username and password have been supplied
using HTTP Basic authentication. Otherwise returns `None`.
"""
auth = get_authorization_header(request).split()
if not auth or auth[0].lower() != b'basic':
return None
if len(auth) == 1:
msg = 'Invalid basic header. No credentials provided.'
raise exceptions.AuthenticationFailed(msg)
elif len(auth) > 2:
msg = 'Invalid basic header. Credentials string should not contain spaces.'
raise exceptions.AuthenticationFailed(msg)
try:
auth_parts = base64.b64decode(auth[1]).decode(HTTP_HEADER_ENCODING).partition(':')
except (TypeError, UnicodeDecodeError):
msg = 'Invalid basic header. Credentials not correctly base64 encoded'
raise exceptions.AuthenticationFailed(msg)
userid, password = auth_parts[0], auth_parts[2]
return self.authenticate_credentials(userid, password)
def authenticate_credentials(self, userid, password):
"""
Authenticate the userid and password against username and password.
"""
user = authenticate(username=userid, password=password)
if user is None or not user.is_active:
raise exceptions.AuthenticationFailed('Invalid username/password')
return (user, None)
def authenticate_header(self, request):
return 'Basic realm="%s"' % self.www_authenticate_realm
class SessionAuthentication(BaseAuthentication):
"""
Use Django's session framework for authentication.
"""
def authenticate(self, request):
"""
Returns a `User` if the request session currently has a logged in user.
Otherwise returns `None`.
"""
# Get the underlying HttpRequest object
request = request._request
user = getattr(request, 'user', None)
# Unauthenticated, CSRF validation not required
if not user or not user.is_active:
return None
self.enforce_csrf(request)
# CSRF passed with authenticated user
return (user, None)
def enforce_csrf(self, request):
"""
Enforce CSRF validation for session based authentication.
"""
reason = CSRFCheck().process_view(request, None, (), {})
if reason:
# CSRF failed, bail with explicit error message
raise exceptions.AuthenticationFailed('CSRF Failed: %s' % reason)

1111
taiga/base/api/fields.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,49 +16,44 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This code is partially taken from django-rest-framework: # The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie # Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import warnings from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404 from django.http import Http404
from django.shortcuts import get_object_or_404 as _get_object_or_404
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework.request import clone_request
from rest_framework.settings import api_settings
from . import views from . import views
from . import mixins from . import mixins
from . import pagination
from .settings import api_settings
from .utils import get_object_or_404
def strict_positive_int(integer_string, cutoff=None): class GenericAPIView(pagination.PaginationMixin,
""" views.APIView):
Cast a string to a strictly positive integer.
"""
ret = int(integer_string)
if ret <= 0:
raise ValueError()
if cutoff:
ret = min(ret, cutoff)
return ret
def get_object_or_404(queryset, *filter_args, **filter_kwargs):
"""
Same as Django's standard shortcut, but make sure to raise 404
if the filter_kwargs don't match the required types.
"""
try:
return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
except (TypeError, ValueError):
raise Http404
class GenericAPIView(views.APIView):
""" """
Base class for all other generic views. Base class for all other generic views.
""" """
@ -65,6 +62,7 @@ class GenericAPIView(views.APIView):
# or override `get_queryset()`/`get_serializer_class()`. # or override `get_queryset()`/`get_serializer_class()`.
queryset = None queryset = None
serializer_class = None serializer_class = None
validator_class = None
# This shortcut may be used instead of setting either or both # This shortcut may be used instead of setting either or both
# of the `queryset`/`serializer_class` attributes, although using # of the `queryset`/`serializer_class` attributes, although using
@ -76,20 +74,13 @@ class GenericAPIView(views.APIView):
lookup_field = 'pk' lookup_field = 'pk'
lookup_url_kwarg = None lookup_url_kwarg = None
# Pagination settings
paginate_by = api_settings.PAGINATE_BY
paginate_by_param = api_settings.PAGINATE_BY_PARAM
max_paginate_by = api_settings.MAX_PAGINATE_BY
pagination_serializer_class = api_settings.DEFAULT_PAGINATION_SERIALIZER_CLASS
page_kwarg = 'page'
# The filter backend classes to use for queryset filtering # The filter backend classes to use for queryset filtering
filter_backends = api_settings.DEFAULT_FILTER_BACKENDS filter_backends = api_settings.DEFAULT_FILTER_BACKENDS
# The following attributes may be subject to change, # The following attributes may be subject to change,
# and should be considered private API. # and should be considered private API.
model_serializer_class = api_settings.DEFAULT_MODEL_SERIALIZER_CLASS model_serializer_class = api_settings.DEFAULT_MODEL_SERIALIZER_CLASS
paginator_class = Paginator model_validator_class = api_settings.DEFAULT_MODEL_VALIDATOR_CLASS
###################################### ######################################
# These are pending deprecation... # These are pending deprecation...
@ -99,7 +90,7 @@ class GenericAPIView(views.APIView):
slug_field = 'slug' slug_field = 'slug'
allow_empty = True allow_empty = True
def get_serializer_context(self): def get_extra_context(self):
""" """
Extra context provided to the serializer class. Extra context provided to the serializer class.
""" """
@ -112,80 +103,26 @@ class GenericAPIView(views.APIView):
def get_serializer(self, instance=None, data=None, def get_serializer(self, instance=None, data=None,
files=None, many=False, partial=False): files=None, many=False, partial=False):
""" """
Return the serializer instance that should be used for validating and Return the serializer instance that should be used for deserializing
deserializing input, and for serializing output. input, and for serializing output.
""" """
serializer_class = self.get_serializer_class() serializer_class = self.get_serializer_class()
context = self.get_serializer_context() context = self.get_extra_context()
return serializer_class(instance, data=data, files=files, return serializer_class(instance, data=data, files=files,
many=many, partial=partial, context=context) many=many, partial=partial, context=context)
def get_pagination_serializer(self, page): def get_validator(self, instance=None, data=None,
files=None, many=False, partial=False):
""" """
Return a serializer instance to use with paginated data. Return the validator instance that should be used for validating the
input, and for serializing output.
""" """
class SerializerClass(self.pagination_serializer_class): validator_class = self.get_validator_class()
class Meta: context = self.get_extra_context()
object_serializer_class = self.get_serializer_class() return validator_class(instance, data=data, files=files,
many=many, partial=partial, context=context)
pagination_serializer_class = SerializerClass def filter_queryset(self, queryset, filter_backends=None):
context = self.get_serializer_context()
return pagination_serializer_class(instance=page, context=context)
def paginate_queryset(self, queryset, page_size=None):
"""
Paginate a queryset if required, either returning a page object,
or `None` if pagination is not configured for this view.
"""
deprecated_style = False
if page_size is not None:
warnings.warn('The `page_size` parameter to `paginate_queryset()` '
'is due to be deprecated. '
'Note that the return style of this method is also '
'changed, and will simply return a page object '
'when called without a `page_size` argument.',
PendingDeprecationWarning, stacklevel=2)
deprecated_style = True
else:
# Determine the required page size.
# If pagination is not configured, simply return None.
page_size = self.get_paginate_by()
if not page_size:
return None
if not self.allow_empty:
warnings.warn(
'The `allow_empty` parameter is due to be deprecated. '
'To use `allow_empty=False` style behavior, You should override '
'`get_queryset()` and explicitly raise a 404 on empty querysets.',
PendingDeprecationWarning, stacklevel=2
)
paginator = self.paginator_class(queryset, page_size,
allow_empty_first_page=self.allow_empty)
page_kwarg = self.kwargs.get(self.page_kwarg)
page_query_param = self.request.QUERY_PARAMS.get(self.page_kwarg)
page = page_kwarg or page_query_param or 1
try:
page_number = paginator.validate_number(page)
except InvalidPage:
if page == 'last':
page_number = paginator.num_pages
else:
raise Http404(_("Page is not 'last', nor can it be converted to an int."))
try:
page = paginator.page(page_number)
except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s): %(message)s') % {
'page_number': page_number,
'message': str(e)
})
if deprecated_style:
return (paginator, page, page.object_list, page.has_other_pages())
return page
def filter_queryset(self, queryset):
""" """
Given a queryset, filter it with whichever filter backend is in use. Given a queryset, filter it with whichever filter backend is in use.
@ -194,7 +131,10 @@ class GenericAPIView(views.APIView):
method if you want to apply the configured filtering backend to the method if you want to apply the configured filtering backend to the
default queryset. default queryset.
""" """
for backend in self.get_filter_backends(): # NOTE TAIGA: Added filter_backends to overwrite the default behavior.
backends = filter_backends or self.get_filter_backends()
for backend in backends:
queryset = backend().filter_queryset(self.request, queryset, self) queryset = backend().filter_queryset(self.request, queryset, self)
return queryset return queryset
@ -204,39 +144,16 @@ class GenericAPIView(views.APIView):
""" """
filter_backends = self.filter_backends or [] filter_backends = self.filter_backends or []
if not filter_backends and hasattr(self, 'filter_backend'): if not filter_backends and hasattr(self, 'filter_backend'):
raise RuntimeException('The `filter_backend` attribute and `FILTER_BACKEND` setting ' raise RuntimeError('The `filter_backend` attribute and `FILTER_BACKEND` setting '
'are due to be deprecated in favor of a `filter_backends` ' 'are due to be deprecated in favor of a `filter_backends` '
'attribute and `DEFAULT_FILTER_BACKENDS` setting, that take ' 'attribute and `DEFAULT_FILTER_BACKENDS` setting, that take '
'a *list* of filter backend classes.') 'a *list* of filter backend classes.')
return filter_backends return filter_backends
###########################################################
######################## # The following methods provide default implementations #
### The following methods provide default implementations # that you may want to override for more complex cases. #
### that you may want to override for more complex cases. ###########################################################
def get_paginate_by(self, queryset=None):
"""
Return the size of pages to use with pagination.
If `PAGINATE_BY_PARAM` is set it will attempt to get the page size
from a named query parameter in the url, eg. ?page_size=100
Otherwise defaults to using `self.paginate_by`.
"""
if queryset is not None:
raise RuntimeException('The `queryset` parameter to `get_paginate_by()` '
'is due to be deprecated.')
if self.paginate_by_param:
try:
return strict_positive_int(
self.request.QUERY_PARAMS[self.paginate_by_param],
cutoff=self.max_paginate_by
)
except (KeyError, ValueError):
pass
return self.paginate_by
def get_serializer_class(self): def get_serializer_class(self):
if self.action == "list" and hasattr(self, "list_serializer_class"): if self.action == "list" and hasattr(self, "list_serializer_class"):
@ -246,17 +163,31 @@ class GenericAPIView(views.APIView):
if serializer_class is not None: if serializer_class is not None:
return serializer_class return serializer_class
assert self.model is not None, \ assert self.model is not None, ("'%s' should either include a 'serializer_class' attribute, "
"'%s' should either include a 'serializer_class' attribute, " \ "or use the 'model' attribute as a shortcut for "
"or use the 'model' attribute as a shortcut for " \ "automatically generating a serializer class." % self.__class__.__name__)
"automatically generating a serializer class." \
% self.__class__.__name__
class DefaultSerializer(self.model_serializer_class): class DefaultSerializer(self.model_serializer_class):
class Meta: class Meta:
model = self.model model = self.model
return DefaultSerializer return DefaultSerializer
def get_validator_class(self):
validator_class = self.validator_class
serializer_class = self.get_serializer_class()
# Situations where the validator is the rest framework serializer
if validator_class is None and serializer_class is not None:
return serializer_class
if validator_class is not None:
return validator_class
class DefaultValidator(self.model_validator_class):
class Meta:
model = self.model
return DefaultValidator
def get_queryset(self): def get_queryset(self):
""" """
Get the list of items for this view. Get the list of items for this view.
@ -274,8 +205,7 @@ class GenericAPIView(views.APIView):
if self.model is not None: if self.model is not None:
return self.model._default_manager.all() return self.model._default_manager.all()
raise ImproperlyConfigured("'%s' must define 'queryset' or 'model'" raise ImproperlyConfigured(("'%s' must define 'queryset' or 'model'" % self.__class__.__name__))
% self.__class__.__name__)
def get_object(self, queryset=None): def get_object(self, queryset=None):
""" """
@ -291,7 +221,7 @@ class GenericAPIView(views.APIView):
else: else:
# NOTE: explicit exception for avoid and fix # NOTE: explicit exception for avoid and fix
# usage of deprecated way of get_object # usage of deprecated way of get_object
raise RuntimeException("DEPRECATED") raise RuntimeError("DEPRECATED")
# Perform the lookup filtering. # Perform the lookup filtering.
# Note that `pk` and `slug` are deprecated styles of lookup filtering. # Note that `pk` and `slug` are deprecated styles of lookup filtering.
@ -303,18 +233,16 @@ class GenericAPIView(views.APIView):
if lookup is not None: if lookup is not None:
filter_kwargs = {self.lookup_field: lookup} filter_kwargs = {self.lookup_field: lookup}
elif pk is not None and self.lookup_field == 'pk': elif pk is not None and self.lookup_field == 'pk':
raise RuntimeException('The `pk_url_kwarg` attribute is due to be deprecated. ' raise RuntimeError(('The `pk_url_kwarg` attribute is due to be deprecated. '
'Use the `lookup_field` attribute instead') 'Use the `lookup_field` attribute instead'))
elif slug is not None and self.lookup_field == 'pk': elif slug is not None and self.lookup_field == 'pk':
raise RuntimeException('The `slug_url_kwarg` attribute is due to be deprecated. ' raise RuntimeError(('The `slug_url_kwarg` attribute is due to be deprecated. '
'Use the `lookup_field` attribute instead') 'Use the `lookup_field` attribute instead'))
else: else:
raise ImproperlyConfigured( raise ImproperlyConfigured(('Expected view %s to be called with a URL keyword argument '
'Expected view %s to be called with a URL keyword argument ' 'named "%s". Fix your URL conf, or set the `.lookup_field` '
'named "%s". Fix your URL conf, or set the `.lookup_field` ' 'attribute on the view correctly.' %
'attribute on the view correctly.' % (self.__class__.__name__, self.lookup_field)))
(self.__class__.__name__, self.lookup_field)
)
obj = get_object_or_404(queryset, **filter_kwargs) obj = get_object_or_404(queryset, **filter_kwargs)
return obj return obj
@ -325,12 +253,13 @@ class GenericAPIView(views.APIView):
except Http404: except Http404:
return None return None
######################## ###################################################
### The following are placeholder methods, # The following are placeholder methods, #
### and are intended to be overridden. # and are intended to be overridden. #
### # #
### The are not called by GenericAPIView directly, # The are not called by GenericAPIView directly, #
### but are used by the mixin methods. # but are used by the mixin methods. #
###################################################
def pre_conditions_on_save(self, obj): def pre_conditions_on_save(self, obj):
""" """
@ -374,11 +303,11 @@ class GenericAPIView(views.APIView):
pass pass
########################################################## ######################################################
### Concrete view classes that provide method handlers ### # Concrete view classes that provide method handlers #
### by composing the mixin classes with the base view. ### # by composing the mixin classes with the base view. #
### NOTE: not used by taiga. ### # NOTE: not used by taiga. #
########################################################## ######################################################
class CreateAPIView(mixins.CreateModelMixin, class CreateAPIView(mixins.CreateModelMixin,
GenericAPIView): GenericAPIView):

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,20 +16,46 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This code is partially taken from django-rest-framework: # The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie # Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import warnings import warnings
from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404
from django.http import Http404 from django.http import Http404
from django.db import transaction as tx from django.db import transaction as tx
from django.utils.translation import ugettext as _
from rest_framework import status from taiga.base import response
from rest_framework.response import Response from taiga.base.exceptions import ValidationError
from rest_framework.request import clone_request
from rest_framework.settings import api_settings from .settings import api_settings
from .utils import get_object_or_404
from .. import exceptions as exc
from ..decorators import model_pk_lock
def _get_validation_exclusions(obj, pk=None, slug_field=None, lookup_field=None): def _get_validation_exclusions(obj, pk=None, slug_field=None, lookup_field=None):
@ -57,25 +85,26 @@ def _get_validation_exclusions(obj, pk=None, slug_field=None, lookup_field=None)
return [field.name for field in obj._meta.fields if field.name not in include] return [field.name for field in obj._meta.fields if field.name not in include]
class CreateModelMixin(object): class CreateModelMixin:
""" """
Create a model instance. Create a model instance.
""" """
def create(self, request, *args, **kwargs): def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.DATA, files=request.FILES) validator = self.get_validator(data=request.DATA, files=request.FILES)
if serializer.is_valid(): if validator.is_valid():
self.check_permissions(request, 'create', serializer.object) self.check_permissions(request, 'create', validator.object)
self.pre_save(serializer.object) self.pre_save(validator.object)
self.pre_conditions_on_save(serializer.object) self.pre_conditions_on_save(validator.object)
self.object = serializer.save(force_insert=True) self.object = validator.save(force_insert=True)
self.post_save(self.object, created=True) self.post_save(self.object, created=True)
instance = self.get_queryset().get(id=self.object.id)
serializer = self.get_serializer(instance)
headers = self.get_success_headers(serializer.data) headers = self.get_success_headers(serializer.data)
return Response(serializer.data, status=status.HTTP_201_CREATED, return response.Created(serializer.data, headers=headers)
headers=headers)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) return response.BadRequest(validator.errors)
def get_success_headers(self, data): def get_success_headers(self, data):
try: try:
@ -84,7 +113,7 @@ class CreateModelMixin(object):
return {} return {}
class ListModelMixin(object): class ListModelMixin:
""" """
List a queryset. List a queryset.
""" """
@ -96,12 +125,10 @@ class ListModelMixin(object):
# Default is to allow empty querysets. This can be altered by setting # Default is to allow empty querysets. This can be altered by setting
# `.allow_empty = False`, to raise 404 errors on empty querysets. # `.allow_empty = False`, to raise 404 errors on empty querysets.
if not self.allow_empty and not self.object_list: if not self.allow_empty and not self.object_list:
warnings.warn( warnings.warn('The `allow_empty` parameter is due to be deprecated. '
'The `allow_empty` parameter is due to be deprecated. ' 'To use `allow_empty=False` style behavior, You should override '
'To use `allow_empty=False` style behavior, You should override ' '`get_queryset()` and explicitly raise a 404 on empty querysets.',
'`get_queryset()` and explicitly raise a 404 on empty querysets.', PendingDeprecationWarning)
PendingDeprecationWarning
)
class_name = self.__class__.__name__ class_name = self.__class__.__name__
error_msg = self.empty_error % {'class_name': class_name} error_msg = self.empty_error % {'class_name': class_name}
raise Http404(error_msg) raise Http404(error_msg)
@ -113,10 +140,10 @@ class ListModelMixin(object):
else: else:
serializer = self.get_serializer(self.object_list, many=True) serializer = self.get_serializer(self.object_list, many=True)
return Response(serializer.data) return response.Ok(serializer.data)
class RetrieveModelMixin(object): class RetrieveModelMixin:
""" """
Retrieve a model instance. Retrieve a model instance.
""" """
@ -129,44 +156,51 @@ class RetrieveModelMixin(object):
raise Http404 raise Http404
serializer = self.get_serializer(self.object) serializer = self.get_serializer(self.object)
return Response(serializer.data) return response.Ok(serializer.data)
class UpdateModelMixin(object): class UpdateModelMixin:
""" """
Update a model instance. Update a model instance.
""" """
@tx.atomic @tx.atomic
@model_pk_lock
def update(self, request, *args, **kwargs): def update(self, request, *args, **kwargs):
partial = kwargs.pop('partial', False) partial = kwargs.pop('partial', False)
self.object = self.get_object_or_none() self.object = self.get_object_or_none()
self.check_permissions(request, 'update', self.object) self.check_permissions(request, 'update', self.object)
serializer = self.get_serializer(self.object, data=request.DATA, if self.object is None:
files=request.FILES, partial=partial) raise Http404
if not serializer.is_valid(): validator = self.get_validator(self.object, data=request.DATA,
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) files=request.FILES, partial=partial)
if not validator.is_valid():
return response.BadRequest(validator.errors)
# Hooks # Hooks
try: try:
self.pre_save(serializer.object) self.pre_save(validator.object)
self.pre_conditions_on_save(serializer.object) self.pre_conditions_on_save(validator.object)
except ValidationError as err: except ValidationError as err:
# full_clean on model instance may be called in pre_save, # full_clean on model instance may be called in pre_save,
# so we have to handle eventual errors. # so we have to handle eventual errors.
return Response(err.message_dict, status=status.HTTP_400_BAD_REQUEST) return response.BadRequest(err.message_dict)
if self.object is None: if self.object is None:
self.object = serializer.save(force_insert=True) self.object = validator.save(force_insert=True)
self.post_save(self.object, created=True) self.post_save(self.object, created=True)
return Response(serializer.data, status=status.HTTP_201_CREATED) instance = self.get_queryset().get(id=self.object.id)
serializer = self.get_serializer(instance)
return response.Created(serializer.data)
self.object = serializer.save(force_update=True) self.object = validator.save(force_update=True)
self.post_save(self.object, created=False) self.post_save(self.object, created=False)
return Response(serializer.data, status=status.HTTP_200_OK) instance = self.get_queryset().get(id=self.object.id)
serializer = self.get_serializer(instance)
return response.Ok(serializer.data)
def partial_update(self, request, *args, **kwargs): def partial_update(self, request, *args, **kwargs):
kwargs['partial'] = True kwargs['partial'] = True
@ -177,14 +211,14 @@ class UpdateModelMixin(object):
Set any attributes on the object that are implicit in the request. Set any attributes on the object that are implicit in the request.
""" """
# pk and/or slug attributes are implicit in the URL. # pk and/or slug attributes are implicit in the URL.
lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field ##lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
lookup = self.kwargs.get(lookup_url_kwarg, None) ##lookup = self.kwargs.get(lookup_url_kwarg, None)
pk = self.kwargs.get(self.pk_url_kwarg, None) pk = self.kwargs.get(self.pk_url_kwarg, None)
slug = self.kwargs.get(self.slug_url_kwarg, None) slug = self.kwargs.get(self.slug_url_kwarg, None)
slug_field = slug and self.slug_field or None slug_field = slug and self.slug_field or None
if lookup: ##if lookup:
setattr(obj, self.lookup_field, lookup) ## setattr(obj, self.lookup_field, lookup)
if pk: if pk:
setattr(obj, 'pk', pk) setattr(obj, 'pk', pk)
@ -199,11 +233,12 @@ class UpdateModelMixin(object):
obj.full_clean(exclude) obj.full_clean(exclude)
class DestroyModelMixin(object): class DestroyModelMixin:
""" """
Destroy a model instance. Destroy a model instance.
""" """
@tx.atomic @tx.atomic
@model_pk_lock
def destroy(self, request, *args, **kwargs): def destroy(self, request, *args, **kwargs):
obj = self.get_object_or_none() obj = self.get_object_or_none()
self.check_permissions(request, 'destroy', obj) self.check_permissions(request, 'destroy', obj)
@ -215,4 +250,54 @@ class DestroyModelMixin(object):
self.pre_conditions_on_delete(obj) self.pre_conditions_on_delete(obj)
obj.delete() obj.delete()
self.post_delete(obj) self.post_delete(obj)
return Response(status=status.HTTP_204_NO_CONTENT) return response.NoContent()
class NestedViewSetMixin(object):
def get_queryset(self):
return self._filter_queryset_by_parents_lookups(super().get_queryset())
def _filter_queryset_by_parents_lookups(self, queryset):
parents_query_dict = self._get_parents_query_dict()
if parents_query_dict:
return queryset.filter(**parents_query_dict)
else:
return queryset
def _get_parents_query_dict(self):
result = {}
for kwarg_name in self.kwargs:
query_value = self.kwargs.get(kwarg_name)
result[kwarg_name] = query_value
return result
## TODO: Move blocked mixind out of the base module because is related to project
class BlockeableModelMixin:
def is_blocked(self, obj):
raise NotImplementedError("is_blocked must be overridden")
def pre_conditions_blocked(self, obj):
# Raises permission exception
if obj is not None and self.is_blocked(obj):
raise exc.Blocked(_("Blocked element"))
class BlockeableSaveMixin(BlockeableModelMixin):
def pre_conditions_on_save(self, obj):
# Called on create and update calls
self.pre_conditions_blocked(obj)
super().pre_conditions_on_save(obj)
class BlockeableDeleteMixin():
def pre_conditions_on_delete(self, obj):
# Called on destroy call
self.pre_conditions_blocked(obj)
super().pre_conditions_on_delete(obj)
class BlockedByProjectMixin(BlockeableSaveMixin, BlockeableDeleteMixin):
def is_blocked(self, obj):
return obj.project is not None and obj.project.blocked_code is not None

View File

@ -0,0 +1,136 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from django.http import Http404
from taiga.base import exceptions
from .settings import api_settings
from .utils.mediatypes import order_by_precedence
from .utils.mediatypes import media_type_matches
from .utils.mediatypes import _MediaType
class BaseContentNegotiation(object):
def select_parser(self, request, parsers):
raise NotImplementedError(".select_parser() must be implemented")
def select_renderer(self, request, renderers, format_suffix=None):
raise NotImplementedError(".select_renderer() must be implemented")
class DefaultContentNegotiation(BaseContentNegotiation):
settings = api_settings
def select_parser(self, request, parsers):
"""
Given a list of parsers and a media type, return the appropriate
parser to handle the incoming request.
"""
for parser in parsers:
if media_type_matches(parser.media_type, request.content_type):
return parser
return None
def select_renderer(self, request, renderers, format_suffix=None):
"""
Given a request and a list of renderers, return a two-tuple of:
(renderer, media type).
"""
# Allow URL style format override. eg. "?format=json
format_query_param = self.settings.URL_FORMAT_OVERRIDE
format = format_suffix or request.QUERY_PARAMS.get(format_query_param)
if format:
renderers = self.filter_renderers(renderers, format)
accepts = self.get_accept_list(request)
# Check the acceptable media types against each renderer,
# attempting more specific media types first
# NB. The inner loop here isni't as bad as it first looks :)
# Worst case is we"re looping over len(accept_list) * len(self.renderers)
for media_type_set in order_by_precedence(accepts):
for renderer in renderers:
for media_type in media_type_set:
if media_type_matches(renderer.media_type, media_type):
# Return the most specific media type as accepted.
if (_MediaType(renderer.media_type).precedence >
_MediaType(media_type).precedence):
# Eg client requests "*/*"
# Accepted media type is "application/json"
return renderer, renderer.media_type
else:
# Eg client requests "application/json; indent=8"
# Accepted media type is "application/json; indent=8"
return renderer, media_type
raise exceptions.NotAcceptable(available_renderers=renderers)
def filter_renderers(self, renderers, format):
"""
If there is a ".json" style format suffix, filter the renderers
so that we only negotiation against those that accept that format.
"""
renderers = [renderer for renderer in renderers
if renderer.format == format]
if not renderers:
raise Http404
return renderers
def get_accept_list(self, request):
"""
Given the incoming request, return a tokenised list of media
type strings.
Allows URL style accept override. eg. "?accept=application/json"
"""
header = request.META.get("HTTP_ACCEPT", "*/*")
header = request.QUERY_PARAMS.get(self.settings.URL_ACCEPT_OVERRIDE, header)
return [token.strip() for token in header.split(",")]

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,24 +16,230 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from rest_framework.templatetags.rest_framework import replace_query_param from django.core.paginator import (
EmptyPage,
Page,
PageNotAnInteger,
Paginator,
InvalidPage,
)
from django.http import Http404
from django.http import QueryDict
from django.utils.translation import ugettext as _
from .settings import api_settings
from urllib import parse as urlparse
import warnings
class ConditionalPaginationMixin(object): def replace_query_param(url, key, val):
def get_paginate_by(self, *args, **kwargs): """
Given a URL and a key/val pair, set or replace an item in the query
parameters of the URL, and return the new URL.
"""
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(url)
query_dict = QueryDict(query).copy()
query_dict[key] = val
query = query_dict.urlencode()
return urlparse.urlunsplit((scheme, netloc, path, query, fragment))
def strict_positive_int(integer_string, cutoff=None):
"""
Cast a string to a strictly positive integer.
"""
ret = int(integer_string)
if ret <= 0:
raise ValueError()
if cutoff:
ret = min(ret, cutoff)
return ret
class CustomPage(Page):
"""Handle different number of items on the first page."""
def start_index(self):
"""Return the 1-based index of the first item on this page."""
paginator = self.paginator
# Special case, return zero if no items.
if paginator.count == 0:
return 0
elif self.number == 1:
return 1
return (
(self.number - 2) * paginator.per_page + paginator.first_page + 1)
def end_index(self):
"""Return the 1-based index of the last item on this page."""
paginator = self.paginator
# Special case for the last page because there can be orphans.
if self.number == paginator.num_pages:
return paginator.count
return (self.number - 1) * paginator.per_page + paginator.first_page
class LazyPaginator(Paginator):
"""Implement lazy pagination."""
def __init__(self, object_list, per_page, **kwargs):
if 'first_page' in kwargs:
self.first_page = kwargs.pop('first_page')
else:
self.first_page = per_page
super(LazyPaginator, self).__init__(object_list, per_page, **kwargs)
def get_current_per_page(self, number):
return self.first_page if number == 1 else self.per_page
def validate_number(self, number):
try:
number = int(number)
except ValueError:
raise PageNotAnInteger('That page number is not an integer')
if number < 1:
raise EmptyPage('That page number is less than 1')
return number
def page(self, number):
number = self.validate_number(number)
current_per_page = self.get_current_per_page(number)
if number == 1:
bottom = 0
else:
bottom = ((number - 2) * self.per_page + self.first_page)
top = bottom + current_per_page
# Retrieve more objects to check if there is a next page.
objects = list(self.object_list[bottom:top + self.orphans + 1])
objects_count = len(objects)
if objects_count > (current_per_page + self.orphans):
# If another page is found, increase the total number of pages.
self._num_pages = number + 1
# In any case, return only objects for this page.
objects = objects[:current_per_page]
elif (number != 1) and (objects_count <= self.orphans):
raise EmptyPage('That page contains no results')
else:
# This is the last page.
self._num_pages = number
return Page(objects, number, self)
def _get_count(self):
raise NotImplementedError
count = property(_get_count)
def _get_num_pages(self):
return self._num_pages
num_pages = property(_get_num_pages)
def _get_page_range(self):
raise NotImplementedError
page_range = property(_get_page_range)
class PaginationMixin(object):
# Pagination settings
paginate_by = api_settings.PAGINATE_BY
paginate_by_param = api_settings.PAGINATE_BY_PARAM
max_paginate_by = api_settings.MAX_PAGINATE_BY
page_kwarg = 'page'
paginator_class = Paginator
def get_paginate_by(self, queryset=None, **kwargs):
"""
Return the size of pages to use with pagination.
If `PAGINATE_BY_PARAM` is set it will attempt to get the page size
from a named query parameter in the url, eg. ?page_size=100
Otherwise defaults to using `self.paginate_by`.
"""
if "HTTP_X_DISABLE_PAGINATION" in self.request.META: if "HTTP_X_DISABLE_PAGINATION" in self.request.META:
return None return None
return super().get_paginate_by(*args, **kwargs)
if queryset is not None:
warnings.warn('The `queryset` parameter to `get_paginate_by()` '
'is due to be deprecated.',
PendingDeprecationWarning, stacklevel=2)
if self.paginate_by_param:
try:
return strict_positive_int(
self.request.QUERY_PARAMS[self.paginate_by_param],
cutoff=self.max_paginate_by
)
except (KeyError, ValueError):
pass
return self.paginate_by
class HeadersPaginationMixin(object):
def paginate_queryset(self, queryset, page_size=None): def paginate_queryset(self, queryset, page_size=None):
page = super().paginate_queryset(queryset=queryset, page_size=page_size) """
Paginate a queryset if required, either returning a page object,
or `None` if pagination is not configured for this view.
"""
if "HTTP_X_DISABLE_PAGINATION" in self.request.META:
return None
if "HTTP_X_LAZY_PAGINATION" in self.request.META:
self.paginator_class = LazyPaginator
deprecated_style = False
if page_size is not None:
warnings.warn('The `page_size` parameter to `paginate_queryset()` '
'is due to be deprecated. '
'Note that the return style of this method is also '
'changed, and will simply return a page object '
'when called without a `page_size` argument.',
PendingDeprecationWarning, stacklevel=2)
deprecated_style = True
else:
# Determine the required page size.
# If pagination is not configured, simply return None.
page_size = self.get_paginate_by()
if not page_size:
return None
if not self.allow_empty:
warnings.warn(
'The `allow_empty` parameter is due to be deprecated. '
'To use `allow_empty=False` style behavior, You should override '
'`get_queryset()` and explicitly raise a 404 on empty querysets.',
PendingDeprecationWarning, stacklevel=2
)
paginator = self.paginator_class(queryset, page_size,
allow_empty_first_page=self.allow_empty)
page_kwarg = self.kwargs.get(self.page_kwarg)
page_query_param = self.request.QUERY_PARAMS.get(self.page_kwarg)
page = page_kwarg or page_query_param or 1
try:
page_number = paginator.validate_number(page)
except InvalidPage:
if page == 'last':
page_number = paginator.num_pages
else:
raise Http404(_("Page is not 'last', nor can it be converted to an int."))
try:
page = paginator.page(page_number)
except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s): %(message)s') % {
'page_number': page_number,
'message': str(e)
})
if page is None: if page is None:
return page return page
self.headers["x-pagination-count"] = page.paginator.count if not "HTTP_X_LAZY_PAGINATION" in self.request.META:
self.headers["x-pagination-count"] = page.paginator.count
self.headers["x-paginated"] = "true" self.headers["x-paginated"] = "true"
self.headers["x-paginated-by"] = page.paginator.per_page self.headers["x-paginated-by"] = page.paginator.per_page
self.headers["x-pagination-current"] = page.number self.headers["x-pagination-current"] = page.number

245
taiga/base/api/parsers.py Normal file
View File

@ -0,0 +1,245 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Parsers are used to parse the content of incoming HTTP requests.
They give us a generic way of being able to handle various media types
on the request, such as form content or json encoded data.
"""
from django.conf import settings
from django.core.files.uploadhandler import StopFutureHandlers
from django.http import QueryDict
from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser
from django.http.multipartparser import MultiPartParserError, parse_header, ChunkIter
from django.utils import six
from taiga.base.exceptions import ParseError
from taiga.base.api import renderers
import json
import datetime
import decimal
class DataAndFiles(object):
def __init__(self, data, files):
self.data = data
self.files = files
class BaseParser(object):
"""
All parsers should extend `BaseParser`, specifying a `media_type`
attribute, and overriding the `.parse()` method.
"""
media_type = None
def parse(self, stream, media_type=None, parser_context=None):
"""
Given a stream to read from, return the parsed representation.
Should return parsed data, or a `DataAndFiles` object consisting of the
parsed data and files.
"""
raise NotImplementedError(".parse() must be overridden.")
class JSONParser(BaseParser):
"""
Parses JSON-serialized data.
"""
media_type = "application/json"
renderer_class = renderers.UnicodeJSONRenderer
def parse(self, stream, media_type=None, parser_context=None):
"""
Parses the incoming bytestream as JSON and returns the resulting data.
"""
parser_context = parser_context or {}
encoding = parser_context.get("encoding", settings.DEFAULT_CHARSET)
try:
data = stream.read().decode(encoding)
return json.loads(data)
except ValueError as exc:
raise ParseError("JSON parse error - %s" % six.text_type(exc))
class FormParser(BaseParser):
"""
Parser for form data.
"""
media_type = "application/x-www-form-urlencoded"
def parse(self, stream, media_type=None, parser_context=None):
"""
Parses the incoming bytestream as a URL encoded form,
and returns the resulting QueryDict.
"""
parser_context = parser_context or {}
encoding = parser_context.get("encoding", settings.DEFAULT_CHARSET)
data = QueryDict(stream.read(), encoding=encoding)
return data
class MultiPartParser(BaseParser):
"""
Parser for multipart form data, which may include file data.
"""
media_type = "multipart/form-data"
def parse(self, stream, media_type=None, parser_context=None):
"""
Parses the incoming bytestream as a multipart encoded form,
and returns a DataAndFiles object.
`.data` will be a `QueryDict` containing all the form parameters.
`.files` will be a `QueryDict` containing all the form files.
"""
parser_context = parser_context or {}
request = parser_context["request"]
encoding = parser_context.get("encoding", settings.DEFAULT_CHARSET)
meta = request.META.copy()
meta["CONTENT_TYPE"] = media_type
upload_handlers = request.upload_handlers
try:
parser = DjangoMultiPartParser(meta, stream, upload_handlers, encoding)
data, files = parser.parse()
return DataAndFiles(data, files)
except MultiPartParserError as exc:
raise ParseError("Multipart form parse error - %s" % str(exc))
class FileUploadParser(BaseParser):
"""
Parser for file upload data.
"""
media_type = "*/*"
def parse(self, stream, media_type=None, parser_context=None):
"""
Treats the incoming bytestream as a raw file upload and returns
a `DateAndFiles` object.
`.data` will be None (we expect request body to be a file content).
`.files` will be a `QueryDict` containing one "file" element.
"""
parser_context = parser_context or {}
request = parser_context["request"]
encoding = parser_context.get("encoding", settings.DEFAULT_CHARSET)
meta = request.META
upload_handlers = request.upload_handlers
filename = self.get_filename(stream, media_type, parser_context)
# Note that this code is extracted from Django's handling of
# file uploads in MultiPartParser.
content_type = meta.get("HTTP_CONTENT_TYPE",
meta.get("CONTENT_TYPE", ""))
try:
content_length = int(meta.get("HTTP_CONTENT_LENGTH",
meta.get("CONTENT_LENGTH", 0)))
except (ValueError, TypeError):
content_length = None
# See if the handler will want to take care of the parsing.
for handler in upload_handlers:
result = handler.handle_raw_input(None,
meta,
content_length,
None,
encoding)
if result is not None:
return DataAndFiles(None, {"file": result[1]})
# This is the standard case.
possible_sizes = [x.chunk_size for x in upload_handlers if x.chunk_size]
chunk_size = min([2 ** 31 - 4] + possible_sizes)
chunks = ChunkIter(stream, chunk_size)
counters = [0] * len(upload_handlers)
for handler in upload_handlers:
try:
handler.new_file(None, filename, content_type,
content_length, encoding)
except StopFutureHandlers:
break
for chunk in chunks:
for i, handler in enumerate(upload_handlers):
chunk_length = len(chunk)
chunk = handler.receive_data_chunk(chunk, counters[i])
counters[i] += chunk_length
if chunk is None:
break
for i, handler in enumerate(upload_handlers):
file_obj = handler.file_complete(counters[i])
if file_obj:
return DataAndFiles(None, {"file": file_obj})
raise ParseError("FileUpload parse error - "
"none of upload handlers can handle the stream")
def get_filename(self, stream, media_type, parser_context):
"""
Detects the uploaded file name. First searches a "filename" url kwarg.
Then tries to parse Content-Disposition header.
"""
try:
return parser_context["kwargs"]["filename"]
except KeyError:
pass
try:
meta = parser_context["request"].META
disposition = parse_header(meta["HTTP_CONTENT_DISPOSITION"])
return disposition[1]["filename"]
except (AttributeError, KeyError):
pass

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -16,10 +18,13 @@
import abc import abc
from taiga.base.utils import sequence as sq from functools import reduce
from taiga.permissions.service import user_has_perm, is_project_owner
from taiga.permissions.services import user_has_perm, is_project_admin
from django.apps import apps from django.apps import apps
from django.utils.translation import ugettext as _
###################################################################### ######################################################################
# Base permissiones definition # Base permissiones definition
@ -57,7 +62,7 @@ class ResourcePermission(object):
elif inspect.isclass(permset) and issubclass(permset, PermissionComponent): elif inspect.isclass(permset) and issubclass(permset, PermissionComponent):
permset = permset() permset = permset()
else: else:
raise RuntimeError("Invalid permission definition.") raise RuntimeError(_("Invalid permission definition."))
if self.global_perms: if self.global_perms:
permset = (self.global_perms & permset) permset = (self.global_perms & permset)
@ -106,7 +111,7 @@ class Not(PermissionOperator):
super().__init__(component) super().__init__(component)
def check_permissions(self, *args, **kwargs): def check_permissions(self, *args, **kwargs):
component = sq.first(self.components) component = self.components[0]
return (not component.check_permissions(*args, **kwargs)) return (not component.check_permissions(*args, **kwargs))
@ -175,40 +180,16 @@ class HasProjectPerm(PermissionComponent):
return user_has_perm(request.user, self.project_perm, obj) return user_has_perm(request.user, self.project_perm, obj)
class HasProjectParamAndPerm(PermissionComponent): class IsProjectAdmin(PermissionComponent):
def __init__(self, perm, *components):
self.project_perm = perm
super().__init__(*components)
def check_permissions(self, request, view, obj=None): def check_permissions(self, request, view, obj=None):
Project = apps.get_model('projects', 'Project') return is_project_admin(request.user, obj)
project_id = request.QUERY_PARAMS.get("project", None)
try:
project = Project.objects.get(pk=project_id)
except Project.DoesNotExist:
return False
return user_has_perm(request.user, self.project_perm, project)
class HasMandatoryParam(PermissionComponent):
def __init__(self, param, *components):
self.mandatory_param = param
super().__init__(*components)
def check_permissions(self, request, view, obj=None):
param = request.GET.get(self.mandatory_param, None)
if param:
return True
return False
class IsProjectOwner(PermissionComponent):
def check_permissions(self, request, view, obj=None):
return is_project_owner(request.user, obj)
class IsObjectOwner(PermissionComponent): class IsObjectOwner(PermissionComponent):
def check_permissions(self, request, view, obj=None): def check_permissions(self, request, view, obj=None):
if obj.owner is None:
return False
return obj.owner == request.user return obj.owner == request.user
@ -219,8 +200,10 @@ class IsObjectOwner(PermissionComponent):
class AllowAnyPermission(ResourcePermission): class AllowAnyPermission(ResourcePermission):
enought_perms = AllowAny() enought_perms = AllowAny()
class IsAuthenticatedPermission(ResourcePermission): class IsAuthenticatedPermission(ResourcePermission):
enought_perms = IsAuthenticated() enought_perms = IsAuthenticated()
class TaigaResourcePermission(ResourcePermission): class TaigaResourcePermission(ResourcePermission):
enought_perms = IsSuperUser() enought_perms = IsSuperUser()

654
taiga/base/api/relations.py Normal file
View File

@ -0,0 +1,654 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Serializer fields that deal with relationships.
These fields allow you to specify the style that should be used to represent
model relationships, including hyperlinks, primary keys, or slugs.
"""
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import resolve, get_script_prefix, NoReverseMatch
from django import forms
from django.db.models.fields import BLANK_CHOICE_DASH
from django.forms import widgets
from django.forms.models import ModelChoiceIterator
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from .fields import Field, WritableField, get_component, is_simple_callable
from .reverse import reverse
from taiga.base.exceptions import ValidationError
import warnings
from urllib import parse as urlparse
##### Relational fields #####
# Not actually Writable, but subclasses may need to be.
class RelatedField(WritableField):
"""
Base class for related model fields.
This represents a relationship using the unicode representation of the target.
"""
widget = widgets.Select
many_widget = widgets.SelectMultiple
form_field_class = forms.ChoiceField
many_form_field_class = forms.MultipleChoiceField
null_values = (None, "", "None")
cache_choices = False
empty_label = None
read_only = True
many = False
def __init__(self, *args, **kwargs):
# "null" is to be deprecated in favor of "required"
if "null" in kwargs:
warnings.warn("The `null` keyword argument is deprecated. "
"Use the `required` keyword argument instead.",
DeprecationWarning, stacklevel=2)
kwargs["required"] = not kwargs.pop("null")
queryset = kwargs.pop("queryset", None)
self.many = kwargs.pop("many", self.many)
if self.many:
self.widget = self.many_widget
self.form_field_class = self.many_form_field_class
kwargs["read_only"] = kwargs.pop("read_only", self.read_only)
super(RelatedField, self).__init__(*args, **kwargs)
if not self.required:
self.empty_label = BLANK_CHOICE_DASH[0][1]
self.queryset = queryset
def initialize(self, parent, field_name):
super(RelatedField, self).initialize(parent, field_name)
if self.queryset is None and not self.read_only:
manager = getattr(self.parent.opts.model, self.source or field_name)
if hasattr(manager, "related"): # Forward
self.queryset = manager.related.model._default_manager.all()
else: # Reverse
self.queryset = manager.field.rel.to._default_manager.all()
### We need this stuff to make form choices work...
def prepare_value(self, obj):
return self.to_native(obj)
def label_from_instance(self, obj):
"""
Return a readable representation for use with eg. select widgets.
"""
desc = smart_text(obj)
ident = smart_text(self.to_native(obj))
if desc == ident:
return desc
return "%s - %s" % (desc, ident)
def _get_queryset(self):
return self._queryset
def _set_queryset(self, queryset):
self._queryset = queryset
self.widget.choices = self.choices
queryset = property(_get_queryset, _set_queryset)
def _get_choices(self):
# If self._choices is set, then somebody must have manually set
# the property self.choices. In this case, just return self._choices.
if hasattr(self, "_choices"):
return self._choices
# Otherwise, execute the QuerySet in self.queryset to determine the
# choices dynamically. Return a fresh ModelChoiceIterator that has not been
# consumed. Note that we"re instantiating a new ModelChoiceIterator *each*
# time _get_choices() is called (and, thus, each time self.choices is
# accessed) so that we can ensure the QuerySet has not been consumed. This
# construct might look complicated but it allows for lazy evaluation of
# the queryset.
return ModelChoiceIterator(self)
def _set_choices(self, value):
# Setting choices also sets the choices on the widget.
# choices can be any iterable, but we call list() on it because
# it will be consumed more than once.
self._choices = self.widget.choices = list(value)
choices = property(_get_choices, _set_choices)
### Default value handling
def get_default_value(self):
default = super(RelatedField, self).get_default_value()
if self.many and default is None:
return []
return default
### Regular serializer stuff...
def field_to_native(self, obj, field_name):
try:
if self.source == "*":
return self.to_native(obj)
source = self.source or field_name
value = obj
for component in source.split("."):
if value is None:
break
value = get_component(value, component)
except ObjectDoesNotExist:
return None
if value is None:
return None
if self.many:
if is_simple_callable(getattr(value, "all", None)):
return [self.to_native(item) for item in value.all()]
else:
# Also support non-queryset iterables.
# This allows us to also support plain lists of related items.
return [self.to_native(item) for item in value]
return self.to_native(value)
def field_from_native(self, data, files, field_name, into):
if self.read_only:
return
try:
if self.many:
try:
# Form data
value = data.getlist(field_name)
if value == [""] or value == []:
raise KeyError
except AttributeError:
# Non-form data
value = data[field_name]
else:
value = data[field_name]
except KeyError:
if self.partial:
return
value = self.get_default_value()
if value in self.null_values:
if self.required:
raise ValidationError(self.error_messages["required"])
into[(self.source or field_name)] = None
elif self.many:
into[(self.source or field_name)] = [self.from_native(item) for item in value]
else:
into[(self.source or field_name)] = self.from_native(value)
### PrimaryKey relationships
class PrimaryKeyRelatedField(RelatedField):
"""
Represents a relationship as a pk value.
"""
read_only = False
default_error_messages = {
"does_not_exist": _("Invalid pk '%s' - object does not exist."),
"incorrect_type": _("Incorrect type. Expected pk value, received %s."),
}
# TODO: Remove these field hacks...
def prepare_value(self, obj):
return self.to_native(obj.pk)
def label_from_instance(self, obj):
"""
Return a readable representation for use with eg. select widgets.
"""
desc = smart_text(obj)
ident = smart_text(self.to_native(obj.pk))
if desc == ident:
return desc
return "%s - %s" % (desc, ident)
# TODO: Possibly change this to just take `obj`, through prob less performant
def to_native(self, pk):
return pk
def from_native(self, data):
if self.queryset is None:
raise Exception("Writable related fields must include a `queryset` argument")
try:
return self.queryset.get(pk=data)
except ObjectDoesNotExist:
msg = self.error_messages["does_not_exist"] % smart_text(data)
raise ValidationError(msg)
except (TypeError, ValueError):
received = type(data).__name__
msg = self.error_messages["incorrect_type"] % received
raise ValidationError(msg)
def field_to_native(self, obj, field_name):
if self.many:
# To-many relationship
queryset = None
if not self.source:
# Prefer obj.serializable_value for performance reasons
try:
queryset = obj.serializable_value(field_name)
except AttributeError:
pass
if queryset is None:
# RelatedManager (reverse relationship)
source = self.source or field_name
queryset = obj
for component in source.split("."):
if queryset is None:
return []
queryset = get_component(queryset, component)
# Forward relationship
if is_simple_callable(getattr(queryset, "all", None)):
return [self.to_native(item.pk) for item in queryset.all()]
else:
# Also support non-queryset iterables.
# This allows us to also support plain lists of related items.
return [self.to_native(item.pk) for item in queryset]
# To-one relationship
try:
# Prefer obj.serializable_value for performance reasons
pk = obj.serializable_value(self.source or field_name)
except AttributeError:
# RelatedObject (reverse relationship)
try:
pk = getattr(obj, self.source or field_name).pk
except (ObjectDoesNotExist, AttributeError):
return None
# Forward relationship
return self.to_native(pk)
### Slug relationships
class SlugRelatedField(RelatedField):
"""
Represents a relationship using a unique field on the target.
"""
read_only = False
default_error_messages = {
"does_not_exist": _("Object with %s=%s does not exist."),
"invalid": _("Invalid value."),
}
def __init__(self, *args, **kwargs):
self.slug_field = kwargs.pop("slug_field", None)
assert self.slug_field, "slug_field is required"
super(SlugRelatedField, self).__init__(*args, **kwargs)
def to_native(self, obj):
return getattr(obj, self.slug_field)
def from_native(self, data):
if self.queryset is None:
raise Exception("Writable related fields must include a `queryset` argument")
try:
return self.queryset.get(**{self.slug_field: data})
except ObjectDoesNotExist:
raise ValidationError(self.error_messages["does_not_exist"] %
(self.slug_field, smart_text(data)))
except (TypeError, ValueError):
msg = self.error_messages["invalid"]
raise ValidationError(msg)
### Hyperlinked relationships
class HyperlinkedRelatedField(RelatedField):
"""
Represents a relationship using hyperlinking.
"""
read_only = False
lookup_field = "pk"
default_error_messages = {
"no_match": _("Invalid hyperlink - No URL match"),
"incorrect_match": _("Invalid hyperlink - Incorrect URL match"),
"configuration_error": _("Invalid hyperlink due to configuration error"),
"does_not_exist": _("Invalid hyperlink - object does not exist."),
"incorrect_type": _("Incorrect type. Expected url string, received %s."),
}
# These are all pending deprecation
pk_url_kwarg = "pk"
slug_field = "slug"
slug_url_kwarg = None # Defaults to same as `slug_field` unless overridden
def __init__(self, *args, **kwargs):
try:
self.view_name = kwargs.pop("view_name")
except KeyError:
raise ValueError("Hyperlinked field requires \"view_name\" kwarg")
self.lookup_field = kwargs.pop("lookup_field", self.lookup_field)
self.format = kwargs.pop("format", None)
# These are pending deprecation
if "pk_url_kwarg" in kwargs:
msg = "pk_url_kwarg is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
if "slug_url_kwarg" in kwargs:
msg = "slug_url_kwarg is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
if "slug_field" in kwargs:
msg = "slug_field is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
self.pk_url_kwarg = kwargs.pop("pk_url_kwarg", self.pk_url_kwarg)
self.slug_field = kwargs.pop("slug_field", self.slug_field)
default_slug_kwarg = self.slug_url_kwarg or self.slug_field
self.slug_url_kwarg = kwargs.pop("slug_url_kwarg", default_slug_kwarg)
super(HyperlinkedRelatedField, self).__init__(*args, **kwargs)
def get_url(self, obj, view_name, request, format):
"""
Given an object, return the URL that hyperlinks to the object.
May raise a `NoReverseMatch` if the `view_name` and `lookup_field`
attributes are not configured to correctly match the URL conf.
"""
lookup_field = getattr(obj, self.lookup_field)
kwargs = {self.lookup_field: lookup_field}
try:
return reverse(view_name, kwargs=kwargs, request=request, format=format)
except NoReverseMatch:
pass
if self.pk_url_kwarg != "pk":
# Only try pk if it has been explicitly set.
# Otherwise, the default `lookup_field = "pk"` has us covered.
pk = obj.pk
kwargs = {self.pk_url_kwarg: pk}
try:
return reverse(view_name, kwargs=kwargs, request=request, format=format)
except NoReverseMatch:
pass
slug = getattr(obj, self.slug_field, None)
if slug is not None:
# Only try slug if it corresponds to an attribute on the object.
kwargs = {self.slug_url_kwarg: slug}
try:
ret = reverse(view_name, kwargs=kwargs, request=request, format=format)
if self.slug_field == "slug" and self.slug_url_kwarg == "slug":
# If the lookup succeeds using the default slug params,
# then `slug_field` is being used implicitly, and we
# we need to warn about the pending deprecation.
msg = "Implicit slug field hyperlinked fields are pending deprecation." \
"You should set `lookup_field=slug` on the HyperlinkedRelatedField."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
return ret
except NoReverseMatch:
pass
raise NoReverseMatch()
def get_object(self, queryset, view_name, view_args, view_kwargs):
"""
Return the object corresponding to a matched URL.
Takes the matched URL conf arguments, and the queryset, and should
return an object instance, or raise an `ObjectDoesNotExist` exception.
"""
lookup = view_kwargs.get(self.lookup_field, None)
pk = view_kwargs.get(self.pk_url_kwarg, None)
slug = view_kwargs.get(self.slug_url_kwarg, None)
if lookup is not None:
filter_kwargs = {self.lookup_field: lookup}
elif pk is not None:
filter_kwargs = {"pk": pk}
elif slug is not None:
filter_kwargs = {self.slug_field: slug}
else:
raise ObjectDoesNotExist()
return queryset.get(**filter_kwargs)
def to_native(self, obj):
view_name = self.view_name
request = self.context.get("request", None)
format = self.format or self.context.get("format", None)
if request is None:
msg = (
"Using `HyperlinkedRelatedField` without including the request "
"in the serializer context is deprecated. "
"Add `context={'request': request}` when instantiating "
"the serializer."
)
warnings.warn(msg, DeprecationWarning, stacklevel=4)
# If the object has not yet been saved then we cannot hyperlink to it.
if getattr(obj, "pk", None) is None:
return
# Return the hyperlink, or error if incorrectly configured.
try:
return self.get_url(obj, view_name, request, format)
except NoReverseMatch:
msg = (
"Could not resolve URL for hyperlinked relationship using "
"view name '%s'. You may have failed to include the related "
"model in your API, or incorrectly configured the "
"`lookup_field` attribute on this field."
)
raise Exception(msg % view_name)
def from_native(self, value):
# Convert URL -> model instance pk
# TODO: Use values_list
queryset = self.queryset
if queryset is None:
raise Exception("Writable related fields must include a `queryset` argument")
try:
http_prefix = value.startswith(("http:", "https:"))
except AttributeError:
msg = self.error_messages["incorrect_type"]
raise ValidationError(msg % type(value).__name__)
if http_prefix:
# If needed convert absolute URLs to relative path
value = urlparse.urlparse(value).path
prefix = get_script_prefix()
if value.startswith(prefix):
value = "/" + value[len(prefix):]
try:
match = resolve(value)
except Exception:
raise ValidationError(self.error_messages["no_match"])
if match.view_name != self.view_name:
raise ValidationError(self.error_messages["incorrect_match"])
try:
return self.get_object(queryset, match.view_name,
match.args, match.kwargs)
except (ObjectDoesNotExist, TypeError, ValueError):
raise ValidationError(self.error_messages["does_not_exist"])
class HyperlinkedIdentityField(Field):
"""
Represents the instance, or a property on the instance, using hyperlinking.
"""
lookup_field = "pk"
read_only = True
# These are all pending deprecation
pk_url_kwarg = "pk"
slug_field = "slug"
slug_url_kwarg = None # Defaults to same as `slug_field` unless overridden
def __init__(self, *args, **kwargs):
try:
self.view_name = kwargs.pop("view_name")
except KeyError:
msg = "HyperlinkedIdentityField requires \"view_name\" argument"
raise ValueError(msg)
self.format = kwargs.pop("format", None)
lookup_field = kwargs.pop("lookup_field", None)
self.lookup_field = lookup_field or self.lookup_field
# These are pending deprecation
if "pk_url_kwarg" in kwargs:
msg = "pk_url_kwarg is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
if "slug_url_kwarg" in kwargs:
msg = "slug_url_kwarg is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
if "slug_field" in kwargs:
msg = "slug_field is pending deprecation. Use lookup_field instead."
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
self.slug_field = kwargs.pop("slug_field", self.slug_field)
default_slug_kwarg = self.slug_url_kwarg or self.slug_field
self.pk_url_kwarg = kwargs.pop("pk_url_kwarg", self.pk_url_kwarg)
self.slug_url_kwarg = kwargs.pop("slug_url_kwarg", default_slug_kwarg)
super(HyperlinkedIdentityField, self).__init__(*args, **kwargs)
def field_to_native(self, obj, field_name):
request = self.context.get("request", None)
format = self.context.get("format", None)
view_name = self.view_name
if request is None:
warnings.warn("Using `HyperlinkedIdentityField` without including the "
"request in the serializer context is deprecated. "
"Add `context={'request': request}` when instantiating the serializer.",
DeprecationWarning, stacklevel=4)
# By default use whatever format is given for the current context
# unless the target is a different type to the source.
#
# Eg. Consider a HyperlinkedIdentityField pointing from a json
# representation to an html property of that representation...
#
# "/snippets/1/" should link to "/snippets/1/highlight/"
# ...but...
# "/snippets/1/.json" should link to "/snippets/1/highlight/.html"
if format and self.format and self.format != format:
format = self.format
# Return the hyperlink, or error if incorrectly configured.
try:
return self.get_url(obj, view_name, request, format)
except NoReverseMatch:
msg = (
"Could not resolve URL for hyperlinked relationship using "
"view name '%s'. You may have failed to include the related "
"model in your API, or incorrectly configured the "
"`lookup_field` attribute on this field."
)
raise Exception(msg % view_name)
def get_url(self, obj, view_name, request, format):
"""
Given an object, return the URL that hyperlinks to the object.
May raise a `NoReverseMatch` if the `view_name` and `lookup_field`
attributes are not configured to correctly match the URL conf.
"""
lookup_field = getattr(obj, self.lookup_field, None)
kwargs = {self.lookup_field: lookup_field}
# Handle unsaved object case
if lookup_field is None:
return None
try:
return reverse(view_name, kwargs=kwargs, request=request, format=format)
except NoReverseMatch:
pass
if self.pk_url_kwarg != "pk":
# Only try pk lookup if it has been explicitly set.
# Otherwise, the default `lookup_field = "pk"` has us covered.
kwargs = {self.pk_url_kwarg: obj.pk}
try:
return reverse(view_name, kwargs=kwargs, request=request, format=format)
except NoReverseMatch:
pass
slug = getattr(obj, self.slug_field, None)
if slug:
# Only use slug lookup if a slug field exists on the model
kwargs = {self.slug_url_kwarg: slug}
try:
return reverse(view_name, kwargs=kwargs, request=request, format=format)
except NoReverseMatch:
pass
raise NoReverseMatch()

311
taiga/base/api/renderers.py Normal file
View File

@ -0,0 +1,311 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Renderers are used to serialize a response into specific media types.
They give us a generic way of being able to handle various media types
on the response, such as JSON encoded data or HTML output.
REST framework also provides an HTML renderer the renders the browsable API.
"""
from django.core.exceptions import ImproperlyConfigured
from django.http.multipartparser import parse_header
from django.template import RequestContext, loader, Template
from django.test.client import encode_multipart
from django.utils import six
from .utils import encoders
import json
class BaseRenderer(object):
"""
All renderers should extend this class, setting the `media_type`
and `format` attributes, and override the `.render()` method.
"""
media_type = None
format = None
charset = "utf-8"
render_style = "text"
def render(self, data, accepted_media_type=None, renderer_context=None):
raise NotImplemented("Renderer class requires .render() to be implemented")
class JSONRenderer(BaseRenderer):
"""
Renderer which serializes to JSON.
Applies JSON's backslash-u character escaping for non-ascii characters.
"""
media_type = "application/json"
format = "json"
encoder_class = encoders.JSONEncoder
ensure_ascii = True
charset = None
# JSON is a binary encoding, that can be encoded as utf-8, utf-16 or utf-32.
# See: http://www.ietf.org/rfc/rfc4627.txt
# Also: http://lucumr.pocoo.org/2013/7/19/application-mimetypes-and-encodings/
def _get_indent(self, accepted_media_type, renderer_context):
# If "indent" is provided in the context, then pretty print the result.
# E.g. If we"re being called by the BrowsableAPIRenderer.
renderer_context = renderer_context or {}
indent = renderer_context.get("indent", None)
if accepted_media_type:
# If the media type looks like "application/json; indent=4",
# then pretty print the result.
base_media_type, params = parse_header(accepted_media_type.encode("ascii"))
indent = params.get("indent", indent)
try:
indent = max(min(int(indent), 8), 0)
except (ValueError, TypeError):
indent = None
return indent
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
Render `data` into JSON.
"""
if data is None:
return bytes()
indent = self._get_indent(accepted_media_type, renderer_context)
ret = json.dumps(data, cls=self.encoder_class,
indent=indent, ensure_ascii=self.ensure_ascii)
# On python 2.x json.dumps() returns bytestrings if ensure_ascii=True,
# but if ensure_ascii=False, the return type is underspecified,
# and may (or may not) be unicode.
# On python 3.x json.dumps() returns unicode strings.
if isinstance(ret, six.text_type):
return bytes(ret.encode("utf-8"))
return ret
def render_to_file(self, data, outputfile, accepted_media_type=None, renderer_context=None):
"""
Render `data` into a file with JSON format.
"""
if data is None:
return bytes()
indent = self._get_indent(accepted_media_type, renderer_context)
ret = json.dump(data, outputfile, cls=self.encoder_class,
indent=indent, ensure_ascii=self.ensure_ascii)
class UnicodeJSONRenderer(JSONRenderer):
ensure_ascii = False
"""
Renderer which serializes to JSON.
Does *not* apply JSON's character escaping for non-ascii characters.
"""
class JSONPRenderer(JSONRenderer):
"""
Renderer which serializes to json,
wrapping the json output in a callback function.
"""
media_type = "application/javascript"
format = "jsonp"
callback_parameter = "callback"
default_callback = "callback"
charset = "utf-8"
def get_callback(self, renderer_context):
"""
Determine the name of the callback to wrap around the json output.
"""
request = renderer_context.get("request", None)
params = request and request.QUERY_PARAMS or {}
return params.get(self.callback_parameter, self.default_callback)
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
Renders into jsonp, wrapping the json output in a callback function.
Clients may set the callback function name using a query parameter
on the URL, for example: ?callback=exampleCallbackName
"""
renderer_context = renderer_context or {}
callback = self.get_callback(renderer_context)
json = super(JSONPRenderer, self).render(data, accepted_media_type,
renderer_context)
return callback.encode(self.charset) + b"(" + json + b");"
class TemplateHTMLRenderer(BaseRenderer):
"""
An HTML renderer for use with templates.
The data supplied to the Response object should be a dictionary that will
be used as context for the template.
The template name is determined by (in order of preference):
1. An explicit `.template_name` attribute set on the response.
2. An explicit `.template_name` attribute set on this class.
3. The return result of calling `view.get_template_names()`.
For example:
data = {"users": User.objects.all()}
return Response(data, template_name="users.html")
For pre-rendered HTML, see StaticHTMLRenderer.
"""
media_type = "text/html"
format = "html"
template_name = None
exception_template_names = [
"%(status_code)s.html",
"api_exception.html"
]
charset = "utf-8"
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
Renders data to HTML, using Django's standard template rendering.
The template name is determined by (in order of preference):
1. An explicit .template_name set on the response.
2. An explicit .template_name set on this class.
3. The return result of calling view.get_template_names().
"""
renderer_context = renderer_context or {}
view = renderer_context["view"]
request = renderer_context["request"]
response = renderer_context["response"]
if response.exception:
template = self.get_exception_template(response)
else:
template_names = self.get_template_names(response, view)
template = self.resolve_template(template_names)
context = self.resolve_context(data, request, response)
return template.render(context)
def resolve_template(self, template_names):
return loader.select_template(template_names)
def resolve_context(self, data, request, response):
if response.exception:
data["status_code"] = response.status_code
return RequestContext(request, data)
def get_template_names(self, response, view):
if response.template_name:
return [response.template_name]
elif self.template_name:
return [self.template_name]
elif hasattr(view, "get_template_names"):
return view.get_template_names()
elif hasattr(view, "template_name"):
return [view.template_name]
raise ImproperlyConfigured("Returned a template response with no `template_name` attribute set on either the view or response")
def get_exception_template(self, response):
template_names = [name % {"status_code": response.status_code}
for name in self.exception_template_names]
try:
# Try to find an appropriate error template
return self.resolve_template(template_names)
except Exception:
# Fall back to using eg "404 Not Found"
return Template("%d %s" % (response.status_code,
response.status_text.title()))
# Note, subclass TemplateHTMLRenderer simply for the exception behavior
class StaticHTMLRenderer(TemplateHTMLRenderer):
"""
An HTML renderer class that simply returns pre-rendered HTML.
The data supplied to the Response object should be a string representing
the pre-rendered HTML content.
For example:
data = "<html><body>example</body></html>"
return Response(data)
For template rendered HTML, see TemplateHTMLRenderer.
"""
media_type = "text/html"
format = "html"
charset = "utf-8"
def render(self, data, accepted_media_type=None, renderer_context=None):
renderer_context = renderer_context or {}
response = renderer_context["response"]
if response and response.exception:
request = renderer_context["request"]
template = self.get_exception_template(response)
context = self.resolve_context(data, request, response)
return template.render(context)
return data
class MultiPartRenderer(BaseRenderer):
media_type = "multipart/form-data; boundary=BoUnDaRyStRiNg"
format = "multipart"
charset = "utf-8"
BOUNDARY = "BoUnDaRyStRiNg"
def render(self, data, accepted_media_type=None, renderer_context=None):
return encode_multipart(self.BOUNDARY, data)

465
taiga/base/api/request.py Normal file
View File

@ -0,0 +1,465 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
The Request class is used as a wrapper around the standard request object.
The wrapped request then offers a richer API, in particular :
- content automatically parsed according to `Content-Type` header,
and available as `request.DATA`
- full support of PUT method, including support for file uploads
- form overloading of HTTP method, content type and content
"""
from django.conf import settings
from django.http import QueryDict
from django.http.multipartparser import parse_header
from django.utils.datastructures import MultiValueDict
from django.utils.six import BytesIO
from taiga.base import exceptions
from . import HTTP_HEADER_ENCODING
from .settings import api_settings
def is_form_media_type(media_type):
"""
Return True if the media type is a valid form media type.
"""
base_media_type, params = parse_header(media_type.encode(HTTP_HEADER_ENCODING))
return (base_media_type == "application/x-www-form-urlencoded" or
base_media_type == "multipart/form-data")
class override_method(object):
"""
A context manager that temporarily overrides the method on a request,
additionally setting the `view.request` attribute.
Usage:
with override_method(view, request, "POST") as request:
... # Do stuff with `view` and `request`
"""
def __init__(self, view, request, method):
self.view = view
self.request = request
self.method = method
def __enter__(self):
self.view.request = clone_request(self.request, self.method)
return self.view.request
def __exit__(self, *args, **kwarg):
self.view.request = self.request
class Empty(object):
"""
Placeholder for unset attributes.
Cannot use `None`, as that may be a valid value.
"""
pass
def _hasattr(obj, name):
return not getattr(obj, name) is Empty
def clone_request(request, method):
"""
Internal helper method to clone a request, replacing with a different
HTTP method. Used for checking permissions against other methods.
"""
ret = Request(request=request._request,
parsers=request.parsers,
authenticators=request.authenticators,
negotiator=request.negotiator,
parser_context=request.parser_context)
ret._data = request._data
ret._files = request._files
ret._content_type = request._content_type
ret._stream = request._stream
ret._method = method
if hasattr(request, "_user"):
ret._user = request._user
if hasattr(request, "_auth"):
ret._auth = request._auth
if hasattr(request, "_authenticator"):
ret._authenticator = request._authenticator
return ret
class ForcedAuthentication(object):
"""
This authentication class is used if the test client or request factory
forcibly authenticated the request.
"""
def __init__(self, force_user, force_token):
self.force_user = force_user
self.force_token = force_token
def authenticate(self, request):
return (self.force_user, self.force_token)
class Request(object):
"""
Wrapper allowing to enhance a standard `HttpRequest` instance.
Kwargs:
- request(HttpRequest). The original request instance.
- parsers_classes(list/tuple). The parsers to use for parsing the
request content.
- authentication_classes(list/tuple). The authentications used to try
authenticating the request's user.
"""
_METHOD_PARAM = api_settings.FORM_METHOD_OVERRIDE
_CONTENT_PARAM = api_settings.FORM_CONTENT_OVERRIDE
_CONTENTTYPE_PARAM = api_settings.FORM_CONTENTTYPE_OVERRIDE
def __init__(self, request, parsers=None, authenticators=None,
negotiator=None, parser_context=None):
self._request = request
self.parsers = parsers or ()
self.authenticators = authenticators or ()
self.negotiator = negotiator or self._default_negotiator()
self.parser_context = parser_context
self._data = Empty
self._files = Empty
self._method = Empty
self._content_type = Empty
self._stream = Empty
if self.parser_context is None:
self.parser_context = {}
self.parser_context["request"] = self
self.parser_context["encoding"] = request.encoding or settings.DEFAULT_CHARSET
force_user = getattr(request, "_force_auth_user", None)
force_token = getattr(request, "_force_auth_token", None)
if (force_user is not None or force_token is not None):
forced_auth = ForcedAuthentication(force_user, force_token)
self.authenticators = (forced_auth,)
def _default_negotiator(self):
return api_settings.DEFAULT_CONTENT_NEGOTIATION_CLASS()
@property
def method(self):
"""
Returns the HTTP method.
This allows the `method` to be overridden by using a hidden `form`
field on a form POST request.
"""
if not _hasattr(self, "_method"):
self._load_method_and_content_type()
return self._method
@property
def content_type(self):
"""
Returns the content type header.
This should be used instead of `request.META.get("HTTP_CONTENT_TYPE")`,
as it allows the content type to be overridden by using a hidden form
field on a form POST request.
"""
if not _hasattr(self, "_content_type"):
self._load_method_and_content_type()
return self._content_type
@property
def stream(self):
"""
Returns an object that may be used to stream the request content.
"""
if not _hasattr(self, "_stream"):
self._load_stream()
return self._stream
@property
def QUERY_PARAMS(self):
"""
More semantically correct name for request.GET.
"""
return self._request.GET
@property
def DATA(self):
"""
Parses the request body and returns the data.
Similar to usual behaviour of `request.POST`, except that it handles
arbitrary parsers, and also works on methods other than POST (eg PUT).
"""
if not _hasattr(self, "_data"):
self._load_data_and_files()
return self._data
@property
def FILES(self):
"""
Parses the request body and returns any files uploaded in the request.
Similar to usual behaviour of `request.FILES`, except that it handles
arbitrary parsers, and also works on methods other than POST (eg PUT).
"""
if not _hasattr(self, "_files"):
self._load_data_and_files()
return self._files
@property
def user(self):
"""
Returns the user associated with the current request, as authenticated
by the authentication classes provided to the request.
"""
if not hasattr(self, "_user"):
self._authenticate()
return self._user
@user.setter
def user(self, value):
"""
Sets the user on the current request. This is necessary to maintain
compatibility with django.contrib.auth where the user property is
set in the login and logout functions.
"""
self._user = value
@property
def auth(self):
"""
Returns any non-user authentication information associated with the
request, such as an authentication token.
"""
if not hasattr(self, "_auth"):
self._authenticate()
return self._auth
@auth.setter
def auth(self, value):
"""
Sets any non-user authentication information associated with the
request, such as an authentication token.
"""
self._auth = value
@property
def successful_authenticator(self):
"""
Return the instance of the authentication instance class that was used
to authenticate the request, or `None`.
"""
if not hasattr(self, "_authenticator"):
self._authenticate()
return self._authenticator
def _load_data_and_files(self):
"""
Parses the request content into self.DATA and self.FILES.
"""
if not _hasattr(self, "_content_type"):
self._load_method_and_content_type()
if not _hasattr(self, "_data"):
self._data, self._files = self._parse()
def _load_method_and_content_type(self):
"""
Sets the method and content_type, and then check if they"ve
been overridden.
"""
self._content_type = self.META.get("HTTP_CONTENT_TYPE",
self.META.get("CONTENT_TYPE", ""))
self._perform_form_overloading()
if not _hasattr(self, "_method"):
self._method = self._request.method
# Allow X-HTTP-METHOD-OVERRIDE header
self._method = self.META.get("HTTP_X_HTTP_METHOD_OVERRIDE",
self._method)
def _load_stream(self):
"""
Return the content body of the request, as a stream.
"""
try:
content_length = int(self.META.get("CONTENT_LENGTH",
self.META.get("HTTP_CONTENT_LENGTH")))
except (ValueError, TypeError):
content_length = 0
if content_length == 0:
self._stream = None
elif hasattr(self._request, "read"):
self._stream = self._request
else:
self._stream = BytesIO(self.raw_post_data)
def _perform_form_overloading(self):
"""
If this is a form POST request, then we need to check if the method and
content/content_type have been overridden by setting them in hidden
form fields or not.
"""
USE_FORM_OVERLOADING = (
self._METHOD_PARAM or
(self._CONTENT_PARAM and self._CONTENTTYPE_PARAM)
)
# We only need to use form overloading on form POST requests.
if (not USE_FORM_OVERLOADING
or self._request.method != "POST"
or not is_form_media_type(self._content_type)):
return
# At this point we"re committed to parsing the request as form data.
self._data = self._request.POST
self._files = self._request.FILES
# Method overloading - change the method and remove the param from the content.
if (self._METHOD_PARAM and
self._METHOD_PARAM in self._data):
self._method = self._data[self._METHOD_PARAM].upper()
# Content overloading - modify the content type, and force re-parse.
if (self._CONTENT_PARAM and
self._CONTENTTYPE_PARAM and
self._CONTENT_PARAM in self._data and
self._CONTENTTYPE_PARAM in self._data):
self._content_type = self._data[self._CONTENTTYPE_PARAM]
self._stream = BytesIO(self._data[self._CONTENT_PARAM].encode(self.parser_context["encoding"]))
self._data, self._files = (Empty, Empty)
def _parse(self):
"""
Parse the request content, returning a two-tuple of (data, files)
May raise an `UnsupportedMediaType`, or `ParseError` exception.
"""
stream = self.stream
media_type = self.content_type
if stream is None or media_type is None:
empty_data = QueryDict("", self._request._encoding)
empty_files = MultiValueDict()
return (empty_data, empty_files)
parser = self.negotiator.select_parser(self, self.parsers)
if not parser:
raise exceptions.UnsupportedMediaType(media_type)
try:
parsed = parser.parse(stream, media_type, self.parser_context)
except:
# If we get an exception during parsing, fill in empty data and
# re-raise. Ensures we don't simply repeat the error when
# attempting to render the browsable renderer response, or when
# logging the request or similar.
self._data = QueryDict("", self._request._encoding)
self._files = MultiValueDict()
raise
# Parser classes may return the raw data, or a
# DataAndFiles object. Unpack the result as required.
try:
return (parsed.data, parsed.files)
except AttributeError:
empty_files = MultiValueDict()
return (parsed, empty_files)
def _authenticate(self):
"""
Attempt to authenticate the request using each authentication instance
in turn.
Returns a three-tuple of (authenticator, user, authtoken).
"""
for authenticator in self.authenticators:
try:
user_auth_tuple = authenticator.authenticate(self)
except exceptions.APIException:
self._not_authenticated()
raise
if not user_auth_tuple is None:
self._authenticator = authenticator
self._user, self._auth = user_auth_tuple
return
self._not_authenticated()
def _not_authenticated(self):
"""
Return a three-tuple of (authenticator, user, authtoken), representing
an unauthenticated request.
By default this will be (None, AnonymousUser, None).
"""
self._authenticator = None
if api_settings.UNAUTHENTICATED_USER:
self._user = api_settings.UNAUTHENTICATED_USER()
else:
self._user = None
if api_settings.UNAUTHENTICATED_TOKEN:
self._auth = api_settings.UNAUTHENTICATED_TOKEN()
else:
self._auth = None
def __getattr__(self, attr):
"""
Proxy other attributes to the underlying HttpRequest object.
"""
return getattr(self._request, attr)

66
taiga/base/api/reverse.py Normal file
View File

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Provide reverse functions that return fully qualified URLs
"""
from django.core.urlresolvers import reverse as django_reverse
from django.utils.functional import lazy
def reverse(viewname, args=None, kwargs=None, request=None, format=None, **extra):
"""
Same as `django.core.urlresolvers.reverse`, but optionally takes a request
and returns a fully qualified URL, using the request to get the base URL.
"""
if format is not None:
kwargs = kwargs or {}
kwargs["format"] = format
url = django_reverse(viewname, args=args, kwargs=kwargs, **extra)
if request:
return request.build_absolute_uri(url)
return url
reverse_lazy = lazy(reverse, str)

File diff suppressed because it is too large Load Diff

254
taiga/base/api/settings.py Normal file
View File

@ -0,0 +1,254 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Settings for REST framework are all namespaced in the REST_FRAMEWORK setting.
For example your project's `settings.py` file might look like this:
REST_FRAMEWORK = {
"DEFAULT_RENDERER_CLASSES": (
"taiga.base.api.renderers.JSONRenderer",
)
"DEFAULT_PARSER_CLASSES": (
"taiga.base.api.parsers.JSONParser",
)
}
This module provides the `api_setting` object, that is used to access
REST framework settings, checking for user settings first, then falling
back to the defaults.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.utils import six
import importlib
from . import ISO_8601
USER_SETTINGS = getattr(settings, "REST_FRAMEWORK", None)
DEFAULTS = {
# Base API policies
"DEFAULT_RENDERER_CLASSES": (
"taiga.base.api.renderers.JSONRenderer",
),
"DEFAULT_PARSER_CLASSES": (
"taiga.base.api.parsers.JSONParser",
"taiga.base.api.parsers.FormParser",
"taiga.base.api.parsers.MultiPartParser"
),
"DEFAULT_AUTHENTICATION_CLASSES": (
"taiga.base.api.authentication.SessionAuthentication",
"taiga.base.api.authentication.BasicAuthentication"
),
"DEFAULT_PERMISSION_CLASSES": (
"taiga.base.api.permissions.AllowAny",
),
"DEFAULT_THROTTLE_CLASSES": (
),
"DEFAULT_CONTENT_NEGOTIATION_CLASS":
"taiga.base.api.negotiation.DefaultContentNegotiation",
# Genric view behavior
"DEFAULT_MODEL_SERIALIZER_CLASS":
"taiga.base.api.serializers.ModelSerializer",
"DEFAULT_MODEL_VALIDATOR_CLASS":
"taiga.base.api.validators.ModelValidator",
"DEFAULT_FILTER_BACKENDS": (),
# Throttling
"DEFAULT_THROTTLE_RATES": {
"user": None,
"anon": None,
},
"DEFAULT_THROTTLE_WHITELIST": [],
# Pagination
"PAGINATE_BY": None,
"PAGINATE_BY_PARAM": None,
"MAX_PAGINATE_BY": None,
# Authentication
"UNAUTHENTICATED_USER": "django.contrib.auth.models.AnonymousUser",
"UNAUTHENTICATED_TOKEN": None,
# View configuration
"VIEW_NAME_FUNCTION": "taiga.base.api.views.get_view_name",
"VIEW_DESCRIPTION_FUNCTION": "taiga.base.api.views.get_view_description",
# Exception handling
"EXCEPTION_HANDLER": "taiga.base.api.views.exception_handler",
# Testing
"TEST_REQUEST_RENDERER_CLASSES": (
"taiga.base.api.renderers.MultiPartRenderer",
"taiga.base.api.renderers.JSONRenderer"
),
"TEST_REQUEST_DEFAULT_FORMAT": "multipart",
# Browser enhancements
"FORM_METHOD_OVERRIDE": "_method",
"FORM_CONTENT_OVERRIDE": "_content",
"FORM_CONTENTTYPE_OVERRIDE": "_content_type",
"URL_ACCEPT_OVERRIDE": "accept",
"URL_FORMAT_OVERRIDE": "format",
"FORMAT_SUFFIX_KWARG": "format",
"URL_FIELD_NAME": "url",
# Input and output formats
"DATE_INPUT_FORMATS": (
ISO_8601,
),
"DATE_FORMAT": ISO_8601,
"DATETIME_INPUT_FORMATS": (
ISO_8601,
),
"DATETIME_FORMAT": None,
"TIME_INPUT_FORMATS": (
ISO_8601,
),
"TIME_FORMAT": None,
# Pending deprecation
"FILTER_BACKEND": None,
}
# List of settings that may be in string import notation.
IMPORT_STRINGS = (
"DEFAULT_RENDERER_CLASSES",
"DEFAULT_PARSER_CLASSES",
"DEFAULT_AUTHENTICATION_CLASSES",
"DEFAULT_PERMISSION_CLASSES",
"DEFAULT_THROTTLE_CLASSES",
"DEFAULT_CONTENT_NEGOTIATION_CLASS",
"DEFAULT_MODEL_SERIALIZER_CLASS",
"DEFAULT_FILTER_BACKENDS",
"EXCEPTION_HANDLER",
"FILTER_BACKEND",
"TEST_REQUEST_RENDERER_CLASSES",
"UNAUTHENTICATED_USER",
"UNAUTHENTICATED_TOKEN",
"VIEW_NAME_FUNCTION",
"VIEW_DESCRIPTION_FUNCTION"
)
def perform_import(val, setting_name):
"""
If the given setting is a string import notation,
then perform the necessary import or imports.
"""
if isinstance(val, six.string_types):
return import_from_string(val, setting_name)
elif isinstance(val, (list, tuple)):
return [import_from_string(item, setting_name) for item in val]
return val
def import_from_string(val, setting_name):
"""
Attempt to import a class from a string representation.
"""
try:
# Nod to tastypie's use of importlib.
parts = val.split('.')
module_path, class_name = '.'.join(parts[:-1]), parts[-1]
module = importlib.import_module(module_path)
return getattr(module, class_name)
except ImportError as e:
msg = "Could not import '%s' for API setting '%s'. %s: %s." % (val, setting_name, e.__class__.__name__, e)
raise ImportError(msg)
class APISettings(object):
"""
A settings object, that allows API settings to be accessed as properties.
For example:
from taiga.base.api.settings import api_settings
print api_settings.DEFAULT_RENDERER_CLASSES
Any setting with string import paths will be automatically resolved
and return the class, rather than the string literal.
"""
def __init__(self, user_settings=None, defaults=None, import_strings=None):
self.user_settings = user_settings or {}
self.defaults = defaults or {}
self.import_strings = import_strings or ()
def __getattr__(self, attr):
if attr not in self.defaults.keys():
raise AttributeError("Invalid API setting: '%s'" % attr)
try:
# Check if present in user settings
val = self.user_settings[attr]
except KeyError:
# Fall back to defaults
val = self.defaults[attr]
# Coerce import strings into classes
if val and attr in self.import_strings:
val = perform_import(val, attr)
self.validate_setting(attr, val)
# Cache the result
setattr(self, attr, val)
return val
def validate_setting(self, attr, val):
if attr == "FILTER_BACKEND" and val is not None:
# Make sure we can initialize the class
val()
api_settings = APISettings(USER_SETTINGS, DEFAULTS, IMPORT_STRINGS)

View File

@ -0,0 +1,296 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Provides various throttling policies.
"""
from django.core.cache import cache as default_cache
from django.core.exceptions import ImproperlyConfigured
from .settings import api_settings
import time
class BaseThrottle(object):
"""
Rate throttling of requests.
"""
def allow_request(self, request, view):
"""
Return `True` if the request should be allowed, `False` otherwise.
"""
raise NotImplementedError(".allow_request() must be overridden")
def finalize(self, request, response, view):
"""
Optionally, update the Trottling information based on de response.
"""
return None
def wait(self):
"""
Optionally, return a recommended number of seconds to wait before
the next request.
"""
return None
class SimpleRateThrottle(BaseThrottle):
"""
A simple cache implementation, that only requires `.get_cache_key()`
to be overridden.
The rate (requests / seconds) is set by a `throttle` attribute on the View
class. The attribute is a string of the form "number_of_requests/period".
Period should be one of: ("s", "sec", "m", "min", "h", "hour", "d", "day")
Previous request information used for throttling is stored in the cache.
"""
cache = default_cache
timer = time.time
cache_format = "throtte_%(scope)s_%(ident)s"
scope = None
THROTTLE_RATES = api_settings.DEFAULT_THROTTLE_RATES
def __init__(self):
if not getattr(self, "rate", None):
self.rate = self.get_rate()
self.num_requests, self.duration = self.parse_rate(self.rate)
def get_cache_key(self, request, view):
"""
Should return a unique cache-key which can be used for throttling.
Must be overridden.
May return `None` if the request should not be throttled.
"""
raise NotImplementedError(".get_cache_key() must be overridden")
def has_to_finalize(self, request, response, view):
"""
Determine if the finalize method must be executed.
"""
return self.rate is not None
def get_rate(self):
"""
Determine the string representation of the allowed request rate.
"""
if not getattr(self, "scope", None):
msg = ("You must set either `.scope` or `.rate` for \"%s\" throttle" %
self.__class__.__name__)
raise ImproperlyConfigured(msg)
try:
return self.THROTTLE_RATES[self.scope]
except KeyError:
msg = "No default throttle rate set for \"%s\" scope" % self.scope
raise ImproperlyConfigured(msg)
def parse_rate(self, rate):
"""
Given the request rate string, return a two tuple of:
<allowed number of requests>, <period of time in seconds>
"""
if rate is None:
return (None, None)
num, period = rate.split("/")
num_requests = int(num)
duration = {"s": 1, "m": 60, "h": 3600, "d": 86400}[period[0]]
return (num_requests, duration)
def allow_request(self, request, view):
"""
Implement the check to see if the request should be throttled.
On success calls `throttle_success`.
On failure calls `throttle_failure`.
"""
if self.rate is None:
return True
self.key = self.get_cache_key(request, view)
if self.key is None:
return True
self.history = self.cache.get(self.key, [])
self.now = self.timer()
# Drop any requests from the history which have now passed the
# throttle duration
while self.history and self.history[-1] <= self.now - self.duration:
self.history.pop()
if self.exceeded_throttling_restriction(request, view):
return self.throttle_failure()
return self.throttle_success(request, view)
def exceeded_throttling_restriction(self, request, view):
return len(self.history) >= self.num_requests
def throttle_success(self, request, view):
"""
Inserts the current request's timestamp along with the key
into the cache.
"""
self.history.insert(0, self.now)
self.cache.set(self.key, self.history, self.duration)
return True
def throttle_failure(self):
"""
Called when a request to the API has failed due to throttling.
"""
return False
def wait(self):
"""
Returns the recommended next request time in seconds.
"""
if self.history:
remaining_duration = self.duration - (self.now - self.history[-1])
else:
remaining_duration = self.duration
available_requests = self.num_requests - len(self.history) + 1
if available_requests <= 0:
return None
return remaining_duration / float(available_requests)
class AnonRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls that may be made by a anonymous users.
The IP address of the request will be used as the unique cache key.
"""
scope = "anon"
def get_cache_key(self, request, view):
if request.user.is_authenticated():
return None # Only throttle unauthenticated requests.
ident = request.META.get("HTTP_X_FORWARDED_FOR")
if ident is None:
ident = request.META.get("REMOTE_ADDR")
return self.cache_format % {
"scope": self.scope,
"ident": ident
}
class UserRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls that may be made by a given user.
The user id will be used as a unique cache key if the user is
authenticated. For anonymous requests, the IP address of the request will
be used.
"""
scope = "user"
def get_cache_key(self, request, view):
if request.user.is_authenticated():
ident = request.user.id
else:
ident = request.META.get("REMOTE_ADDR", None)
return self.cache_format % {
"scope": self.scope,
"ident": ident
}
class ScopedRateThrottle(SimpleRateThrottle):
"""
Limits the rate of API calls by different amounts for various parts of
the API. Any view that has the `throttle_scope` property set will be
throttled. The unique cache key will be generated by concatenating the
user id of the request, and the scope of the view being accessed.
"""
scope_attr = "throttle_scope"
def __init__(self):
# Override the usual SimpleRateThrottle, because we can't determine
# the rate until called by the view.
pass
def allow_request(self, request, view):
# We can only determine the scope once we"re called by the view.
self.scope = getattr(view, self.scope_attr, None)
# If a view does not have a `throttle_scope` always allow the request
if not self.scope:
return True
# Determine the allowed request rate as we normally would during
# the `__init__` call.
self.rate = self.get_rate()
self.num_requests, self.duration = self.parse_rate(self.rate)
# We can now proceed as normal.
return super(ScopedRateThrottle, self).allow_request(request, view)
def get_cache_key(self, request, view):
"""
If `view.throttle_scope` is not set, don't apply this throttle.
Otherwise generate the unique cache key by concatenating the user id
with the ".throttle_scope` property of the view.
"""
if request.user.is_authenticated():
ident = request.user.id
else:
ident = request.META.get("REMOTE_ADDR", None)
return self.cache_format % {
"scope": self.scope,
"ident": ident
}

View File

@ -0,0 +1,107 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from django.core.urlresolvers import RegexURLResolver
from django.conf.urls import url, include
from .settings import api_settings
def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
ret = []
for urlpattern in urlpatterns:
if isinstance(urlpattern, RegexURLResolver):
# Set of included URL patterns
regex = urlpattern.regex.pattern
namespace = urlpattern.namespace
app_name = urlpattern.app_name
kwargs = urlpattern.default_kwargs
# Add in the included patterns, after applying the suffixes
patterns = apply_suffix_patterns(urlpattern.url_patterns,
suffix_pattern,
suffix_required)
ret.append(url(regex, include(patterns, namespace, app_name), kwargs))
else:
# Regular URL pattern
regex = urlpattern.regex.pattern.rstrip("$") + suffix_pattern
view = urlpattern.callback
kwargs = urlpattern.default_args
name = urlpattern.name
# Add in both the existing and the new urlpattern
if not suffix_required:
ret.append(urlpattern)
ret.append(url(regex, view, kwargs, name))
return ret
def format_suffix_patterns(urlpatterns, suffix_required=False, allowed=None):
"""
Supplement existing urlpatterns with corresponding patterns that also
include a ".format" suffix. Retains urlpattern ordering.
urlpatterns:
A list of URL patterns.
suffix_required:
If `True`, only suffixed URLs will be generated, and non-suffixed
URLs will not be used. Defaults to `False`.
allowed:
An optional tuple/list of allowed suffixes. eg ["json", "api"]
Defaults to `None`, which allows any suffix.
"""
suffix_kwarg = api_settings.FORMAT_SUFFIX_KWARG
if allowed:
if len(allowed) == 1:
allowed_pattern = allowed[0]
else:
allowed_pattern = "(%s)" % "|".join(allowed)
suffix_pattern = r"\.(?P<%s>%s)$" % (suffix_kwarg, allowed_pattern)
else:
suffix_pattern = r"\.(?P<%s>[a-z0-9]+)$" % suffix_kwarg
return apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required)

57
taiga/base/api/utils.py Normal file
View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from django.http import Http404
from django.shortcuts import get_object_or_404 as _get_object_or_404
def get_object_or_404(queryset, *filter_args, **filter_kwargs):
"""
Same as Django's standard shortcut, but make sure to raise 404
if the filter_kwargs don't match the required types.
"""
try:
return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
except (TypeError, ValueError):
raise Http404

View File

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from django.http import Http404
from django.shortcuts import get_object_or_404 as _get_object_or_404
def get_object_or_404(queryset, *filter_args, **filter_kwargs):
"""
Same as Django's standard shortcut, but make sure to raise 404
if the filter_kwargs don't match the required types.
"""
try:
return _get_object_or_404(queryset, *filter_args, **filter_kwargs)
except (TypeError, ValueError):
raise Http404

View File

@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Helper classes for parsers.
"""
from django.db.models.query import QuerySet
from django.utils.functional import Promise
from django.utils import timezone
from django.utils.encoding import force_text
import datetime
import decimal
import types
import json
class JSONEncoder(json.JSONEncoder):
"""
JSONEncoder subclass that knows how to encode date/time/timedelta,
decimal types, and generators.
"""
def default(self, o):
# For Date Time string spec, see ECMA 262
# http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
if isinstance(o, Promise):
return force_text(o)
elif isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith("+00:00"):
r = r[:-6] + "Z"
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
if timezone and timezone.is_aware(o):
raise ValueError("JSON can't represent timezone-aware times.")
r = o.isoformat()
if o.microsecond:
r = r[:12]
return r
elif isinstance(o, datetime.timedelta):
return str(o.total_seconds())
elif isinstance(o, decimal.Decimal):
return str(o)
elif isinstance(o, QuerySet):
return list(o)
elif hasattr(o, "tolist"):
return o.tolist()
elif hasattr(o, "__getitem__"):
try:
return dict(o)
except:
pass
elif hasattr(o, "__iter__"):
return [i for i in o]
return super(JSONEncoder, self).default(o)
SafeDumper = None

View File

@ -0,0 +1,120 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Utility functions to return a formatted name and description for a given view.
"""
from django.utils.html import escape
from django.utils.safestring import mark_safe
from taiga.base.api.settings import api_settings
from textwrap import dedent
import re
# Markdown is optional
try:
import markdown
def apply_markdown(text):
"""
Simple wrapper around :func:`markdown.markdown` to set the base level
of '#' style headers to <h2>.
"""
extensions = ["headerid(level=2)"]
safe_mode = False
md = markdown.Markdown(extensions=extensions, safe_mode=safe_mode)
return md.convert(text)
except ImportError:
apply_markdown = None
def remove_trailing_string(content, trailing):
"""
Strip trailing component `trailing` from `content` if it exists.
Used when generating names from view classes.
"""
if content.endswith(trailing) and content != trailing:
return content[:-len(trailing)]
return content
def dedent(content):
"""
Remove leading indent from a block of text.
Used when generating descriptions from docstrings.
Note that python's `textwrap.dedent` doesn't quite cut it,
as it fails to dedent multiline docstrings that include
unindented text on the initial line.
"""
whitespace_counts = [len(line) - len(line.lstrip(" "))
for line in content.splitlines()[1:] if line.lstrip()]
# unindent the content if needed
if whitespace_counts:
whitespace_pattern = "^" + (" " * min(whitespace_counts))
content = re.sub(re.compile(whitespace_pattern, re.MULTILINE), "", content)
return content.strip()
def camelcase_to_spaces(content):
"""
Translate 'CamelCaseNames' to 'Camel Case Names'.
Used when generating names from view classes.
"""
camelcase_boundry = "(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))"
content = re.sub(camelcase_boundry, " \\1", content).strip()
return " ".join(content.split("_")).title()
def markup_description(description):
"""
Apply HTML markup to the given description.
"""
if apply_markdown:
description = apply_markdown(description)
else:
description = escape(description).replace("\n", "<br />")
return mark_safe(description)

View File

@ -0,0 +1,132 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
Handling of media types, as found in HTTP Content-Type and Accept headers.
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
"""
from django.http.multipartparser import parse_header
from taiga.base.api import HTTP_HEADER_ENCODING
def media_type_matches(lhs, rhs):
"""
Returns ``True`` if the media type in the first argument <= the
media type in the second argument. The media types are strings
as described by the HTTP spec.
Valid media type strings include:
'application/json; indent=4'
'application/json'
'text/*'
'*/*'
"""
lhs = _MediaType(lhs)
rhs = _MediaType(rhs)
return lhs.match(rhs)
def order_by_precedence(media_type_lst):
"""
Returns a list of sets of media type strings, ordered by precedence.
Precedence is determined by how specific a media type is:
3. 'type/subtype; param=val'
2. 'type/subtype'
1. 'type/*'
0. '*/*'
"""
ret = [set(), set(), set(), set()]
for media_type in media_type_lst:
precedence = _MediaType(media_type).precedence
ret[3 - precedence].add(media_type)
return [media_types for media_types in ret if media_types]
class _MediaType(object):
def __init__(self, media_type_str):
if media_type_str is None:
media_type_str = ''
self.orig = media_type_str
self.full_type, self.params = parse_header(media_type_str.encode(HTTP_HEADER_ENCODING))
self.main_type, sep, self.sub_type = self.full_type.partition("/")
def match(self, other):
"""Return true if this MediaType satisfies the given MediaType."""
for key in self.params.keys():
if key != "q" and other.params.get(key, None) != self.params.get(key, None):
return False
if self.sub_type != "*" and other.sub_type != "*" and other.sub_type != self.sub_type:
return False
if self.main_type != "*" and other.main_type != "*" and other.main_type != self.main_type:
return False
return True
@property
def precedence(self):
"""
Return a precedence level from 0-3 for the media type given how specific it is.
"""
if self.main_type == "*":
return 0
elif self.sub_type == "*":
return 1
elif not self.params or self.params.keys() == ["q"]:
return 2
return 3
def __str__(self):
return unicode(self).encode("utf-8")
def __unicode__(self):
ret = "%s/%s" % (self.main_type, self.sub_type)
for key, val in self.params.items():
ret += "; %s=%s" % (key, val)
return ret

View File

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import serializers
class Validator(serializers.Serializer):
pass
class ModelValidator(serializers.ModelSerializer):
pass

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,27 +16,58 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This code is partially taken from django-rest-framework: # The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie # Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import json import json
from django.core.exceptions import PermissionDenied from collections import OrderedDict
from django.http import Http404, HttpResponse
from django.utils.datastructures import SortedDict
from django.views.decorators.csrf import csrf_exempt
from rest_framework import status, exceptions
from rest_framework.compat import smart_text, HttpResponseBase, View
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.settings import api_settings
from rest_framework.utils import formatting
from taiga.base.utils.iterators import as_tuple
from django.conf import settings from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.http import Http404, HttpResponse
from django.http.response import HttpResponseBase
from django.views.decorators.csrf import csrf_exempt
from django.views.defaults import server_error from django.views.defaults import server_error
from django.views.generic import View
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from .request import Request
from .settings import api_settings
from .utils import formatting
from taiga.base import status
from taiga.base import exceptions
from taiga.base.response import Response
from taiga.base.response import Ok
from taiga.base.response import NotFound
from taiga.base.response import Forbidden
from taiga.base.utils.iterators import as_tuple
def get_view_name(view_cls, suffix=None): def get_view_name(view_cls, suffix=None):
@ -53,6 +86,7 @@ def get_view_name(view_cls, suffix=None):
return name return name
def get_view_description(view_cls, html=False): def get_view_description(view_cls, html=False):
""" """
Given a view class, return a textual description to represent the view. Given a view class, return a textual description to represent the view.
@ -89,12 +123,10 @@ def exception_handler(exc):
headers=headers) headers=headers)
elif isinstance(exc, Http404): elif isinstance(exc, Http404):
return Response({'detail': 'Not found'}, return NotFound({'detail': _('Not found')})
status=status.HTTP_404_NOT_FOUND)
elif isinstance(exc, PermissionDenied): elif isinstance(exc, PermissionDenied):
return Response({'detail': 'Permission denied'}, return Forbidden({'detail': _('Permission denied')})
status=status.HTTP_403_FORBIDDEN)
# Note: Unhandled exceptions will raise a 500 error. # Note: Unhandled exceptions will raise a 500 error.
return None return None
@ -112,6 +144,8 @@ class APIView(View):
# Allow dependancy injection of other settings to make testing easier. # Allow dependancy injection of other settings to make testing easier.
settings = api_settings settings = api_settings
_trottle_instances = None
@classmethod @classmethod
def as_view(cls, **initkwargs): def as_view(cls, **initkwargs):
""" """
@ -140,7 +174,6 @@ class APIView(View):
headers['Vary'] = 'Accept' headers['Vary'] = 'Accept'
return headers return headers
def http_method_not_allowed(self, request, *args, **kwargs): def http_method_not_allowed(self, request, *args, **kwargs):
""" """
If `request.method` does not correspond to a handler method, If `request.method` does not correspond to a handler method,
@ -255,7 +288,9 @@ class APIView(View):
""" """
Instantiates and returns the list of throttles that this view uses. Instantiates and returns the list of throttles that this view uses.
""" """
return [throttle() for throttle in self.throttle_classes] if self._trottle_instances is None:
self._trottle_instances = [throttle() for throttle in self.throttle_classes]
return self._trottle_instances
def get_content_negotiator(self): def get_content_negotiator(self):
""" """
@ -291,7 +326,7 @@ class APIView(View):
""" """
request.user request.user
def check_permissions(self, request, action, obj=None): def check_permissions(self, request, action:str=None, obj=None):
if action is None: if action is None:
self.permission_denied(request) self.permission_denied(request)
@ -311,6 +346,15 @@ class APIView(View):
if not throttle.allow_request(request, self): if not throttle.allow_request(request, self):
self.throttled(request, throttle.wait()) self.throttled(request, throttle.wait())
def finalize_throttles(self, request, response):
"""
Check if request should be throttled.
Raises an appropriate exception if the request is throttled.
"""
for throttle in self.get_throttles():
if throttle.has_to_finalize(request, response, self):
throttle.finalize(request, response, self)
# Dispatch methods # Dispatch methods
def initialize_request(self, request, *args, **kwargs): def initialize_request(self, request, *args, **kwargs):
@ -344,11 +388,9 @@ class APIView(View):
Returns the final response object. Returns the final response object.
""" """
# Make the error obvious if a proper response is not returned # Make the error obvious if a proper response is not returned
assert isinstance(response, HttpResponseBase), ( assert isinstance(response, HttpResponseBase), ('Expected a `Response`, `HttpResponse` or '
'Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` ' '`HttpStreamingResponse` to be returned from the view, '
'to be returned from the view, but received a `%s`' 'but received a `%s`' % type(response))
% type(response)
)
if isinstance(response, Response): if isinstance(response, Response):
if not getattr(request, 'accepted_renderer', None): if not getattr(request, 'accepted_renderer', None):
@ -362,6 +404,8 @@ class APIView(View):
for key, value in self.headers.items(): for key, value in self.headers.items():
response[key] = value response[key] = value
self.finalize_throttles(request, response)
return response return response
def handle_exception(self, exc): def handle_exception(self, exc):
@ -412,7 +456,6 @@ class APIView(View):
handler = self.http_method_not_allowed handler = self.http_method_not_allowed
response = handler(request, *args, **kwargs) response = handler(request, *args, **kwargs)
except Exception as exc: except Exception as exc:
response = self.handle_exception(exc) response = self.handle_exception(exc)
@ -425,7 +468,7 @@ class APIView(View):
We may as well implement this as Django will otherwise provide We may as well implement this as Django will otherwise provide
a less useful default implementation. a less useful default implementation.
""" """
return Response(self.metadata(request), status=status.HTTP_200_OK) return Ok(self.metadata(request))
def metadata(self, request): def metadata(self, request):
""" """
@ -435,7 +478,7 @@ class APIView(View):
# By default we can't provide any form-like information, however the # By default we can't provide any form-like information, however the
# generic views override this implementation and add additional # generic views override this implementation and add additional
# information for POST and PUT methods, based on the serializer. # information for POST and PUT methods, based on the serializer.
ret = SortedDict() ret = OrderedDict()
ret['name'] = self.get_view_name() ret['name'] = self.get_view_name()
ret['description'] = self.get_view_description() ret['description'] = self.get_view_description()
ret['renders'] = [renderer.media_type for renderer in self.renderer_classes] ret['renders'] = [renderer.media_type for renderer in self.renderer_classes]
@ -444,7 +487,7 @@ class APIView(View):
def api_server_error(request, *args, **kwargs): def api_server_error(request, *args, **kwargs):
if settings.DEBUG == False and request.META['CONTENT_TYPE'] == "application/json": if settings.DEBUG is False and request.META.get('CONTENT_TYPE', None) == "application/json":
return HttpResponse(json.dumps({"error": "Server application error"}), return HttpResponse(json.dumps({"error": _("Server application error")}),
status=status.HTTP_500_INTERNAL_SERVER_ERROR) status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return server_error(request, *args, **kwargs) return server_error(request, *args, **kwargs)

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,16 +16,39 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This code is partially taken from django-rest-framework: # The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie # Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from functools import update_wrapper from functools import update_wrapper
from django.utils.decorators import classonlymethod from django.utils.decorators import classonlymethod
from django.utils.translation import ugettext as _
from . import views from . import views
from . import mixins from . import mixins
from . import generics from . import generics
from . import pagination
class ViewSetMixin(object): class ViewSetMixin(object):
@ -57,8 +82,8 @@ class ViewSetMixin(object):
"keyword argument to %s(). Don't do that." "keyword argument to %s(). Don't do that."
% (key, cls.__name__)) % (key, cls.__name__))
if not hasattr(cls, key): if not hasattr(cls, key):
raise TypeError("%s() received an invalid keyword %r" % ( raise TypeError("%s() received an invalid keyword %r"
cls.__name__, key)) % (cls.__name__, key))
def view(request, *args, **kwargs): def view(request, *args, **kwargs):
self = cls(**initkwargs) self = cls(**initkwargs)
@ -109,6 +134,25 @@ class ViewSetMixin(object):
return super().check_permissions(request, action=action, obj=obj) return super().check_permissions(request, action=action, obj=obj)
class NestedViewSetMixin(object):
def get_queryset(self):
return self._filter_queryset_by_parents_lookups(super().get_queryset())
def _filter_queryset_by_parents_lookups(self, queryset):
parents_query_dict = self._get_parents_query_dict()
if parents_query_dict:
return queryset.filter(**parents_query_dict)
else:
return queryset
def _get_parents_query_dict(self):
result = {}
for kwarg_name in self.kwargs:
query_value = self.kwargs.get(kwarg_name)
result[kwarg_name] = query_value
return result
class ViewSet(ViewSetMixin, views.APIView): class ViewSet(ViewSetMixin, views.APIView):
""" """
The base ViewSet class does not provide any actions by default. The base ViewSet class does not provide any actions by default.
@ -124,14 +168,14 @@ class GenericViewSet(ViewSetMixin, generics.GenericAPIView):
""" """
pass pass
class ReadOnlyListViewSet(pagination.HeadersPaginationMixin,
pagination.ConditionalPaginationMixin, class ReadOnlyListViewSet(GenericViewSet):
GenericViewSet):
""" """
A viewset that provides default `list()` action. A viewset that provides default `list()` action.
""" """
pass pass
class ReadOnlyModelViewSet(mixins.RetrieveModelMixin, class ReadOnlyModelViewSet(mixins.RetrieveModelMixin,
mixins.ListModelMixin, mixins.ListModelMixin,
GenericViewSet): GenericViewSet):
@ -154,15 +198,22 @@ class ModelViewSet(mixins.CreateModelMixin,
pass pass
class ModelCrudViewSet(pagination.HeadersPaginationMixin, class ModelCrudViewSet(ModelViewSet):
pagination.ConditionalPaginationMixin,
ModelViewSet):
pass pass
class ModelListViewSet(pagination.HeadersPaginationMixin, class ModelListViewSet(mixins.RetrieveModelMixin,
pagination.ConditionalPaginationMixin,
mixins.RetrieveModelMixin,
mixins.ListModelMixin, mixins.ListModelMixin,
GenericViewSet): GenericViewSet):
pass pass
class ModelUpdateRetrieveViewSet(mixins.UpdateModelMixin,
mixins.RetrieveModelMixin,
GenericViewSet):
pass
class ModelRetrieveViewSet(mixins.RetrieveModelMixin,
GenericViewSet):
pass

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -13,19 +15,17 @@
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
# Patch api view for correctly return 401 responses on
# request is authenticated instead of 403
from django.apps import AppConfig from django.apps import AppConfig
from . import monkey
class BaseAppConfig(AppConfig): class BaseAppConfig(AppConfig):
name = "taiga.base" name = "taiga.base"
verbose_name = "Base App Config" verbose_name = "Base App Config"
def ready(self): def ready(self):
print("Monkey patching...", file=sys.stderr) from .signals.thumbnails import connect_thumbnail_signals
monkey.patch_restframework() from .signals.cleanup_files import connect_cleanup_files_signals
monkey.patch_serializer()
connect_thumbnail_signals()
connect_cleanup_files_signals()

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -18,10 +20,7 @@ from taiga.base.exceptions import BaseException
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
class ConnectorBaseException(BaseException): class ConnectorBaseException(BaseException):
status_code = 400 status_code = 400
default_detail = _("Connection error.") default_detail = _("Connection error.")
class GitHubApiError(ConnectorBaseException):
pass

View File

@ -1,160 +0,0 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import requests
import json
from collections import namedtuple
from urllib.parse import urljoin
from django.conf import settings
from . import exceptions as exc
######################################################
## Data
######################################################
CLIENT_ID = getattr(settings, "GITHUB_API_CLIENT_ID", None)
CLIENT_SECRET = getattr(settings, "GITHUB_API_CLIENT_SECRET", None)
URL = getattr(settings, "GITHUB_URL", "https://github.com/")
API_URL = getattr(settings, "GITHUB_API_URL", "https://api.github.com/")
API_RESOURCES_URLS = {
"login": {
"authorize": "login/oauth/authorize",
"access-token": "login/oauth/access_token"
},
"user": {
"profile": "user",
"emails": "user/emails"
}
}
HEADERS = {"Accept": "application/json",}
AuthInfo = namedtuple("AuthInfo", ["access_token"])
User = namedtuple("User", ["id", "username", "full_name", "bio"])
Email = namedtuple("Email", ["email", "is_primary"])
######################################################
## utils
######################################################
def _build_url(*args, **kwargs) -> str:
"""
Return a valid url.
"""
resource_url = API_RESOURCES_URLS
for key in args:
resource_url = resource_url[key]
if kwargs:
resource_url = resource_url.format(**kwargs)
return urljoin(API_URL, resource_url)
def _get(url:str, headers:dict) -> dict:
"""
Make a GET call.
"""
response = requests.get(url, headers=headers)
data = response.json()
if response.status_code != 200:
raise exc.GitHubApiError({"status_code": response.status_code,
"error": data.get("error", "")})
return data
def _post(url:str, params:dict, headers:dict) -> dict:
"""
Make a POST call.
"""
response = requests.post(url, params=params, headers=headers)
data = response.json()
if response.status_code != 200 or "error" in data:
raise exc.GitHubApiError({"status_code": response.status_code,
"error": data.get("error", "")})
return data
######################################################
## Simple calls
######################################################
def login(access_code:str, client_id:str=CLIENT_ID, client_secret:str=CLIENT_SECRET,
headers:dict=HEADERS):
"""
Get access_token fron an user authorized code, the client id and the client secret key.
(See https://developer.github.com/v3/oauth/#web-application-flow).
"""
url = urljoin(URL, "login/oauth/access_token")
params={"code": access_code,
"client_id": client_id,
"client_secret": client_secret,
"scope": "user:emails"}
data = _post(url, params=params, headers=headers)
return AuthInfo(access_token=data.get("access_token", None))
def get_user_profile(headers:dict=HEADERS):
"""
Get authenticated user info.
(See https://developer.github.com/v3/users/#get-the-authenticated-user).
"""
url = _build_url("user", "profile")
data = _get(url, headers=headers)
return User(id=data.get("id", None),
username=data.get("login", None),
full_name=(data.get("name", None) or ""),
bio=(data.get("bio", None) or ""))
def get_user_emails(headers:dict=HEADERS) -> list:
"""
Get a list with all emails of the authenticated user.
(See https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user).
"""
url = _build_url("user", "emails")
data = _get(url, headers=headers)
return [Email(email=e.get("email", None), is_primary=e.get("primary", False))
for e in data]
######################################################
## Convined calls
######################################################
def me(access_code:str) -> tuple:
"""
Connect to a github account and get all personal info (profile and the primary email).
"""
auth_info = login(access_code)
headers = HEADERS.copy()
headers["Authorization"] = "token {}".format(auth_info.access_token)
user = get_user_profile(headers=headers)
emails = get_user_emails(headers=headers)
primary_email = next(filter(lambda x: x.is_primary, emails))
return primary_email.email, user

View File

View File

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,12 +16,5 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from .testing import *
DATABASES = { from .json import JSONField
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'taiga',
'USERNAME': 'postgres',
}
}

View File

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib.postgres.fields import JSONField as DjangoJSONField
__all__ = ["JSONField"]
class JSONField(DjangoJSONField):
def __init__(self, verbose_name=None, name=None, encoder=DjangoJSONEncoder, **kwargs):
super().__init__(verbose_name, name, encoder, **kwargs)

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,11 +16,9 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import warnings from django_pglocks import advisory_lock
## Rest Framework 2.4 backport some decorators.
def detail_route(methods=['get'], **kwargs): def detail_route(methods=['get'], **kwargs):
""" """
Used to mark a method on a ViewSet that should be routed for detail requests. Used to mark a method on a ViewSet that should be routed for detail requests.
@ -45,31 +45,18 @@ def list_route(methods=['get'], **kwargs):
return decorator return decorator
def link(**kwargs): def model_pk_lock(func):
""" """
Used to mark a method on a ViewSet that should be routed for detail GET requests. This decorator is designed to be used in ModelViewsets methods to lock them based
on the model and the id of the selected object.
""" """
msg = 'link is pending deprecation. Use detail_route instead.' def decorator(self, *args, **kwargs):
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2) from taiga.base.utils.db import get_typename_for_model_class
def decorator(func): pk = self.kwargs.get(self.pk_url_kwarg, None)
func.bind_to_methods = ['get'] tn = get_typename_for_model_class(self.get_queryset().model)
func.detail = True key = "{0}:{1}".format(tn, pk)
func.permission_classes = kwargs.get('permission_classes', [])
func.kwargs = kwargs
return func
return decorator
with advisory_lock(key):
return func(self, *args, **kwargs)
def action(methods=['post'], **kwargs):
"""
Used to mark a method on a ViewSet that should be routed for detail POST requests.
"""
msg = 'action is pending deprecation. Use detail_route instead.'
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
def decorator(func):
func.bind_to_methods = methods
func.detail = True
func.permission_classes = kwargs.get('permission_classes', [])
func.kwargs = kwargs
return func
return decorator return decorator

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,20 +16,125 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from rest_framework import exceptions
from rest_framework import status """
from rest_framework.response import Response Handled exceptions raised by REST framework.
In addition Django's built in 403 and 404 exceptions are handled.
(`django.http.Http404` and `django.core.exceptions.PermissionDenied`)
"""
from django.core.exceptions import PermissionDenied as DjangoPermissionDenied from django.core.exceptions import PermissionDenied as DjangoPermissionDenied
from django.core.exceptions import ValidationError as DjangoValidationError
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.http import Http404 from django.http import Http404
from .utils.json import to_json from . import response
from . import status
import math
class BaseException(exceptions.APIException): class APIException(Exception):
"""
Base class for REST framework exceptions.
Subclasses should provide `.status_code` and `.default_detail` properties.
"""
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
default_detail = ""
def __init__(self, detail=None):
self.detail = detail or self.default_detail
class ParseError(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = _("Malformed request.")
class AuthenticationFailed(APIException):
status_code = status.HTTP_401_UNAUTHORIZED
default_detail = _("Incorrect authentication credentials.")
class NotAuthenticated(APIException):
status_code = status.HTTP_401_UNAUTHORIZED
default_detail = _("Authentication credentials were not provided.")
class PermissionDenied(APIException):
status_code = status.HTTP_403_FORBIDDEN
default_detail = _("You do not have permission to perform this action.")
class MethodNotAllowed(APIException):
status_code = status.HTTP_405_METHOD_NOT_ALLOWED
default_detail = _("Method '%s' not allowed.")
def __init__(self, method, detail=None):
self.detail = (detail or self.default_detail) % method
class NotAcceptable(APIException):
status_code = status.HTTP_406_NOT_ACCEPTABLE
default_detail = _("Could not satisfy the request's Accept header")
def __init__(self, detail=None, available_renderers=None):
self.detail = detail or self.default_detail
self.available_renderers = available_renderers
class UnsupportedMediaType(APIException):
status_code = status.HTTP_415_UNSUPPORTED_MEDIA_TYPE
default_detail = _("Unsupported media type '%s' in request.")
def __init__(self, media_type, detail=None):
self.detail = (detail or self.default_detail) % media_type
class Throttled(APIException):
status_code = status.HTTP_429_TOO_MANY_REQUESTS
default_detail = _("Request was throttled.")
extra_detail = _("Expected available in %d second%s.")
def __init__(self, wait=None, detail=None):
if wait is None:
self.detail = detail or self.default_detail
self.wait = None
else:
format = "%s%s" % ((detail or self.default_detail), self.extra_detail)
self.detail = format % (wait, wait != 1 and "s" or "")
self.wait = math.ceil(wait)
class BaseException(APIException):
status_code = status.HTTP_400_BAD_REQUEST status_code = status.HTTP_400_BAD_REQUEST
default_detail = _("Unexpected error") default_detail = _("Unexpected error")
@ -69,7 +176,7 @@ class RequestValidationError(BadRequest):
default_detail = _("Data validation error") default_detail = _("Data validation error")
class PermissionDenied(exceptions.PermissionDenied): class PermissionDenied(PermissionDenied):
""" """
Compatibility subclass of restframework `PermissionDenied` Compatibility subclass of restframework `PermissionDenied`
exception. exception.
@ -88,7 +195,7 @@ class PreconditionError(BadRequest):
default_detail = _("Precondition error") default_detail = _("Precondition error")
class NotAuthenticated(exceptions.NotAuthenticated): class NotAuthenticated(NotAuthenticated):
""" """
Compatibility subclass of restframework `NotAuthenticated` Compatibility subclass of restframework `NotAuthenticated`
exception. exception.
@ -96,6 +203,29 @@ class NotAuthenticated(exceptions.NotAuthenticated):
pass pass
class Blocked(APIException):
"""
Exception used on blocked projects
"""
status_code = status.HTTP_451_BLOCKED
default_detail = _("Blocked element")
class NotEnoughSlotsForProject(BaseException):
"""
Exception used on import/edition/creation project errors where the user
hasn't slots enough
"""
default_detail = _("No room left for more projects.")
def __init__(self, is_private, total_memberships, detail=None):
self.detail = detail or self.default_detail
self.project_data = {
"is_private": is_private,
"total_memberships": total_memberships
}
def format_exception(exc): def format_exception(exc):
if isinstance(exc.detail, (dict, list, tuple,)): if isinstance(exc.detail, (dict, list, tuple,)):
detail = exc.detail detail = exc.detail
@ -121,23 +251,27 @@ def exception_handler(exc):
to be raised. to be raised.
""" """
if isinstance(exc, exceptions.APIException): if isinstance(exc, APIException):
headers = {} res = response.Response(format_exception(exc), status=exc.status_code)
if getattr(exc, "auth_header", None):
headers["WWW-Authenticate"] = exc.auth_header
if getattr(exc, "wait", None):
headers["X-Throttle-Wait-Seconds"] = "%d" % exc.wait
detail = format_exception(exc) if getattr(exc, "auth_header", None):
return Response(detail, status=exc.status_code, headers=headers) res["WWW-Authenticate"] = exc.auth_header
if getattr(exc, "wait", None):
res["X-Throttle-Wait-Seconds"] = "%d" % exc.wait
if getattr(exc, "project_data", None):
res["Taiga-Info-Project-Memberships"] = exc.project_data["total_memberships"]
res["Taiga-Info-Project-Is-Private"] = exc.project_data["is_private"]
return res
elif isinstance(exc, Http404): elif isinstance(exc, Http404):
return Response({'_error_message': str(exc)}, return response.NotFound({'_error_message': str(exc)})
status=status.HTTP_404_NOT_FOUND)
elif isinstance(exc, DjangoPermissionDenied): elif isinstance(exc, DjangoPermissionDenied):
return Response({"_error_message": str(exc)}, return response.Forbidden({"_error_message": str(exc)})
status=status.HTTP_403_FORBIDDEN)
# Note: Unhandled exceptions will raise a 500 error. # Note: Unhandled exceptions will raise a 500 error.
return None return None
ValidationError = DjangoValidationError

149
taiga/base/fields.py Normal file
View File

@ -0,0 +1,149 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.forms import widgets
from django.utils.translation import ugettext as _
from taiga.base.api import serializers, ISO_8601
from taiga.base.api.settings import api_settings
import serpy
####################################################################
# DRF Serializer fields (OLD)
####################################################################
# NOTE: This should be in other place, for example taiga.base.api.serializers
class JSONField(serializers.WritableField):
"""
Json objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class PgArrayField(serializers.WritableField):
"""
PgArray objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class PickledObjectField(serializers.WritableField):
"""
PickledObjectField objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class WatchersField(serializers.WritableField):
def to_native(self, obj):
return obj
def from_native(self, data):
return data
####################################################################
# Serpy fields (NEW)
####################################################################
class Field(serpy.Field):
pass
class MethodField(serpy.MethodField):
pass
class I18NField(Field):
def to_value(self, value):
ret = super(I18NField, self).to_value(value)
return _(ret)
class I18NJSONField(Field):
"""
Json objects serializer.
"""
def __init__(self, i18n_fields=(), *args, **kwargs):
super(I18NJSONField, self).__init__(*args, **kwargs)
self.i18n_fields = i18n_fields
def translate_values(self, d):
i18n_d = {}
if d is None:
return d
for key, value in d.items():
if isinstance(value, dict):
i18n_d[key] = self.translate_values(value)
if key in self.i18n_fields:
if isinstance(value, list):
i18n_d[key] = [e is not None and _(str(e)) or e for e in value]
if isinstance(value, str):
i18n_d[key] = value is not None and _(value) or value
else:
i18n_d[key] = value
return i18n_d
def to_native(self, obj):
i18n_obj = self.translate_values(obj)
return i18n_obj
class FileField(Field):
def to_value(self, value):
if value:
return value.name
return None
class DateTimeField(Field):
format = api_settings.DATETIME_FORMAT
def to_value(self, value):
if value is None or self.format is None:
return value
if self.format.lower() == ISO_8601:
ret = value.isoformat()
if ret.endswith("+00:00"):
ret = ret[:-6] + "Z"
return ret
return value.strftime(self.format)

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -13,20 +15,64 @@
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import operator
from functools import reduce
from django.db.models import Q import logging
from django.db.models.sql.where import ExtraWhere, OR, AND
from rest_framework import filters from dateutil.parser import parse as parse_date
from taiga.base import tags from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q, OuterRef, Subquery
from django.utils.translation import ugettext as _
from taiga.projects.models import Membership from taiga.base import exceptions as exc
from taiga.base.api.utils import get_object_or_404
from taiga.base.utils.db import to_tsquery
logger = logging.getLogger(__name__)
class QueryParamsFilterMixin(filters.BaseFilterBackend): def get_filter_expression_can_view_projects(user, project_id=None):
# Filter by user permissions
if user.is_authenticated() and user.is_superuser:
return Q()
elif user.is_authenticated():
# authenticated user & project member
membership_model = apps.get_model("projects", "Membership")
memberships_qs = membership_model.objects.filter(user=user)
if project_id:
memberships_qs = memberships_qs.filter(project_id=project_id)
memberships_qs = memberships_qs.filter(
Q(role__permissions__contains=['view_project']) |
Q(is_admin=True))
projects_list = [membership.project_id for membership in
memberships_qs]
return (Q(id__in=projects_list) |
Q(public_permissions__contains=["view_project"]))
else:
# external users / anonymous
return Q(anon_permissions__contains=["view_project"])
#####################################################################
# Base and Mixins
#####################################################################
class BaseFilterBackend(object):
"""
A base class from which all filter backend classes should inherit.
"""
def filter_queryset(self, request, queryset, view):
"""
Return a filtered queryset.
"""
raise NotImplementedError(".filter_queryset() must be overridden.")
class QueryParamsFilterMixin(BaseFilterBackend):
_special_values_dict = { _special_values_dict = {
'true': True, 'true': True,
'false': False, 'false': False,
@ -53,7 +99,10 @@ class QueryParamsFilterMixin(filters.BaseFilterBackend):
query_params[field_name] = field_data query_params[field_name] = field_data
if query_params: if query_params:
queryset = queryset.filter(**query_params) try:
queryset = queryset.filter(**query_params)
except ValueError:
raise exc.BadRequest(_("Error in filter params types."))
return queryset return queryset
@ -77,7 +126,11 @@ class OrderByFilterMixin(QueryParamsFilterMixin):
if field_name not in order_by_fields: if field_name not in order_by_fields:
return queryset return queryset
return super().filter_queryset(request, queryset.order_by(raw_fieldname), view) if raw_fieldname in ["owner", "-owner", "assigned_to", "-assigned_to"]:
raw_fieldname = "{}__full_name".format(raw_fieldname)
# We need to add a default order if raw_fieldname gives rows with the same value
return super().filter_queryset(request, queryset.order_by(raw_fieldname, "-id"), view)
class FilterBackend(OrderByFilterMixin): class FilterBackend(OrderByFilterMixin):
@ -87,52 +140,66 @@ class FilterBackend(OrderByFilterMixin):
pass pass
class FilterModelAssignedUsers:
def get_assigned_users_filter(self, model, value):
assigned_users_ids = model.objects.order_by().filter(
assigned_users__in=value, id=OuterRef('pk')).values('pk')
assigned_user_filter = Q(pk__in=Subquery(assigned_users_ids))
assigned_to_filter = Q(assigned_to__in=value)
return Q(assigned_user_filter | assigned_to_filter)
#####################################################################
# Permissions filters
#####################################################################
class PermissionBasedFilterBackend(FilterBackend): class PermissionBasedFilterBackend(FilterBackend):
permission = None permission = None
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):
project_id = None project_id = None
if hasattr(view, "filter_fields") and "project" in view.filter_fields: if (hasattr(view, "filter_fields") and "project" in view.filter_fields and
project_id = request.QUERY_PARAMS.get("project", None) "project" in request.QUERY_PARAMS):
try:
project_id = int(request.QUERY_PARAMS["project"])
except:
logger.error("Filtering project diferent value than an integer: {}".format(
request.QUERY_PARAMS["project"]
))
raise exc.BadRequest(_("'project' must be an integer value."))
qs = queryset qs = queryset
if request.user.is_authenticated() and request.user.is_superuser: if request.user.is_authenticated() and request.user.is_superuser:
qs = qs qs = qs
elif request.user.is_authenticated(): elif request.user.is_authenticated():
memberships_qs = Membership.objects.filter(user=request.user) membership_model = apps.get_model('projects', 'Membership')
memberships_qs = membership_model.objects.filter(user=request.user)
if project_id: if project_id:
memberships_qs = memberships_qs.filter(project_id=project_id) memberships_qs = memberships_qs.filter(project_id=project_id)
memberships_qs = memberships_qs.filter(Q(role__permissions__contains=[self.permission]) |
# Force users_role table inclusion Q(is_admin=True))
memberships_qs = memberships_qs.exclude(role__slug="not valid slug")
where_sql = ["users_role.permissions @> ARRAY['{}']".format(self.permission)]
memberships_qs = memberships_qs.extra(where=where_sql)
projects_list = [membership.project_id for membership in memberships_qs] projects_list = [membership.project_id for membership in memberships_qs]
if len(projects_list) == 0: qs = qs.filter(Q(project_id__in=projects_list) |
qs = qs.filter(Q(project__owner=request.user)) Q(project__public_permissions__contains=[self.permission]))
elif len(projects_list) == 1:
qs = qs.filter(Q(project__owner=request.user) | Q(project=projects_list[0]))
else:
qs = qs.filter(Q(project__owner=request.user) | Q(project__in=projects_list))
extra_where = ExtraWhere(["projects_project.public_permissions @> ARRAY['{}']".format(
self.permission)], [])
qs.query.where.add(extra_where, OR)
else: else:
qs = qs.exclude(project__owner=-1) qs = qs.filter(project__anon_permissions__contains=[self.permission])
extra_where = ExtraWhere(["projects_project.anon_permissions @> ARRAY['{}']".format(
self.permission)], [])
qs.query.where.add(extra_where, AND)
return super().filter_queryset(request, qs.distinct(), view) return super().filter_queryset(request, qs, view)
class CanViewProjectFilterBackend(PermissionBasedFilterBackend): class CanViewProjectFilterBackend(PermissionBasedFilterBackend):
permission = "view_project" permission = "view_project"
class CanViewEpicsFilterBackend(PermissionBasedFilterBackend):
permission = "view_epics"
class CanViewUsFilterBackend(PermissionBasedFilterBackend): class CanViewUsFilterBackend(PermissionBasedFilterBackend):
permission = "view_us" permission = "view_us"
@ -157,6 +224,10 @@ class CanViewMilestonesFilterBackend(PermissionBasedFilterBackend):
permission = "view_milestones" permission = "view_milestones"
#####################################################################
# Attachments filters
#####################################################################
class PermissionBasedAttachmentFilterBackend(PermissionBasedFilterBackend): class PermissionBasedAttachmentFilterBackend(PermissionBasedFilterBackend):
permission = None permission = None
@ -167,6 +238,10 @@ class PermissionBasedAttachmentFilterBackend(PermissionBasedFilterBackend):
return qs.filter(content_type=ct) return qs.filter(content_type=ct)
class CanViewEpicAttachmentFilterBackend(PermissionBasedAttachmentFilterBackend):
permission = "view_epics"
class CanViewUserStoryAttachmentFilterBackend(PermissionBasedAttachmentFilterBackend): class CanViewUserStoryAttachmentFilterBackend(PermissionBasedAttachmentFilterBackend):
permission = "view_us" permission = "view_us"
@ -183,71 +258,460 @@ class CanViewWikiAttachmentFilterBackend(PermissionBasedAttachmentFilterBackend)
permission = "view_wiki_pages" permission = "view_wiki_pages"
class CanViewProjectObjFilterBackend(FilterBackend): #####################################################################
# User filters
#####################################################################
class MembersFilterBackend(PermissionBasedFilterBackend):
permission = "view_project"
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):
project_id = None project_id = None
if hasattr(view, "filter_fields") and "project" in view.filter_fields: project = None
project_id = request.QUERY_PARAMS.get("project", None) qs = queryset.filter(is_active=True)
if "project" in request.QUERY_PARAMS:
try:
project_id = int(request.QUERY_PARAMS["project"])
except:
logger.error("Filtering project diferent value than an integer: {}".format(
request.QUERY_PARAMS["project"]))
raise exc.BadRequest(_("'project' must be an integer value."))
qs = queryset if project_id:
Project = apps.get_model('projects', 'Project')
project = get_object_or_404(Project, pk=project_id)
if request.user.is_authenticated() and request.user.is_superuser: if request.user.is_authenticated() and request.user.is_superuser:
qs = qs qs = qs
elif request.user.is_authenticated(): elif request.user.is_authenticated():
Membership = apps.get_model('projects', 'Membership')
memberships_qs = Membership.objects.filter(user=request.user) memberships_qs = Membership.objects.filter(user=request.user)
if project_id: if project_id:
memberships_qs = memberships_qs.filter(project_id=project_id) memberships_qs = memberships_qs.filter(project_id=project_id)
memberships_qs = memberships_qs.exclude(role__slug="not valid slug") # Force users_role table inclusion memberships_qs = memberships_qs.filter(Q(role__permissions__contains=[self.permission]) |
memberships_qs = memberships_qs.extra(where=["users_role.permissions @> ARRAY['view_project']"]) Q(is_admin=True))
projects_list = [membership.project_id for membership in memberships_qs] projects_list = [membership.project_id for membership in memberships_qs]
if len(projects_list) == 0: if project:
qs = qs.filter(Q(owner=request.user)) is_member = project.id in projects_list
elif len(projects_list) == 1: has_project_public_view_permission = "view_project" in project.public_permissions
qs = qs.filter(Q(owner=request.user) | Q(id=projects_list[0])) if not is_member and not has_project_public_view_permission:
else: qs = qs.none()
qs = qs.filter(Q(owner=request.user) | Q(id__in=projects_list))
qs.query.where.add(ExtraWhere(["projects_project.public_permissions @> ARRAY['view_project']"], []), OR) q = Q(memberships__project_id__in=projects_list) | Q(id=request.user.id)
# If there is no selected project we want access to users from public projects
if not project:
q = q | Q(memberships__project__public_permissions__contains=[self.permission])
qs = qs.filter(q)
else: else:
qs.query.where.add(ExtraWhere(["projects_project.anon_permissions @> ARRAY['view_project']"], []), AND) if project and "view_project" not in project.anon_permissions:
qs = qs.none()
return super().filter_queryset(request, qs.distinct(), view) qs = qs.filter(memberships__project__anon_permissions__contains=[self.permission])
return qs.distinct()
class IsProjectMemberFilterBackend(FilterBackend): #####################################################################
def filter_queryset(self, request, queryset, view): # Webhooks filters
#####################################################################
class BaseIsProjectAdminFilterBackend(object):
def get_project_ids(self, request, view):
project_id = None
if hasattr(view, "filter_fields") and "project" in view.filter_fields:
project_id = request.QUERY_PARAMS.get("project", None)
if request.user.is_authenticated() and request.user.is_superuser: if request.user.is_authenticated() and request.user.is_superuser:
queryset = queryset return None
elif request.user.is_authenticated():
queryset = queryset.filter(Q(project__members=request.user) |
Q(project__owner=request.user))
else:
queryset = queryset.none()
return super().filter_queryset(request, queryset.distinct(), view) if not request.user.is_authenticated():
return []
membership_model = apps.get_model('projects', 'Membership')
memberships_qs = membership_model.objects.filter(user=request.user, is_admin=True)
if project_id:
memberships_qs = memberships_qs.filter(project_id=project_id)
projects_list = [membership.project_id for membership in memberships_qs]
return projects_list
class TagsFilter(FilterBackend): class IsProjectAdminFilterBackend(FilterBackend, BaseIsProjectAdminFilterBackend):
def __init__(self, filter_name='tags'):
self.filter_name = filter_name
def _get_tags_queryparams(self, params):
return params.get(self.filter_name, "")
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):
query_tags = self._get_tags_queryparams(request.QUERY_PARAMS) project_ids = self.get_project_ids(request, view)
if query_tags: if project_ids is None:
queryset = tags.filter(queryset, contains=query_tags) queryset = queryset
elif project_ids == []:
queryset = queryset.none()
else:
queryset = queryset.filter(project_id__in=project_ids)
return super().filter_queryset(request, queryset, view) return super().filter_queryset(request, queryset, view)
class IsProjectAdminFromWebhookLogFilterBackend(FilterBackend, BaseIsProjectAdminFilterBackend):
def filter_queryset(self, request, queryset, view):
project_ids = self.get_project_ids(request, view)
if project_ids is None:
queryset = queryset
elif project_ids == []:
queryset = queryset.none()
else:
queryset = queryset.filter(webhook__project_id__in=project_ids)
return super().filter_queryset(request, queryset, view)
#####################################################################
# Generic Attributes filters (for User Stories, Tasks and Issues)
#####################################################################
class BaseRelatedFieldsFilter(FilterBackend):
filter_name = None
param_name = None
exclude_param_name = None
def __init__(self, filter_name=None, param_name=None, exclude_param_name=None):
if filter_name:
self.filter_name = filter_name
if param_name:
self.param_name = param_name
if exclude_param_name:
self.exclude_param_name
def _prepare_filter_data(self, query_param_value):
def _transform_value(value):
try:
return int(value)
except:
if value in self._special_values_dict:
return self._special_values_dict[value]
raise exc.BadRequest()
values = set([x.strip() for x in query_param_value.split(",")])
values = map(_transform_value, values)
return list(values)
def _get_queryparams(self, params, mode=''):
param_name = self.exclude_param_name if mode == 'exclude' else self.param_name or self.filter_name
raw_value = params.get(param_name, None)
if raw_value:
value = self._prepare_filter_data(raw_value)
if None in value:
qs_in_kwargs = {"{}__in".format(self.filter_name): [v for v in value if v is not None]}
qs_isnull_kwargs = {"{}__isnull".format(self.filter_name): True}
return Q(**qs_in_kwargs) | Q(**qs_isnull_kwargs)
else:
return Q(**{"{}__in".format(self.filter_name): value})
return None
def _prepare_filter_query(self, query):
return query
def _prepare_exclude_query(self, query):
return ~Q(query)
def filter_queryset(self, request, queryset, view):
operations = {
"filter": self._prepare_filter_query,
"exclude": self._prepare_exclude_query,
}
for mode, prepare_method in operations.items():
query = self._get_queryparams(request.QUERY_PARAMS, mode=mode)
if query:
queryset = queryset.filter(prepare_method(query))
return super().filter_queryset(request, queryset, view)
class OwnersFilter(BaseRelatedFieldsFilter):
filter_name = 'owner'
exclude_param_name = 'exclude_owner'
class AssignedToFilter(BaseRelatedFieldsFilter):
filter_name = 'assigned_to'
exclude_param_name = 'exclude_assigned_to'
class AssignedUsersFilter(FilterModelAssignedUsers, BaseRelatedFieldsFilter):
filter_name = 'assigned_users'
exclude_param_name = 'exclude_assigned_users'
def _get_queryparams(self, params, mode=''):
param_name = self.exclude_param_name if mode == 'exclude' else self.param_name or self.filter_name
raw_value = params.get(param_name, None)
if raw_value:
value = self._prepare_filter_data(raw_value)
UserStoryModel = apps.get_model("userstories", "UserStory")
if None in value:
value.remove(None)
assigned_users_ids = UserStoryModel.objects.order_by().filter(
assigned_users__isnull=True,
id=OuterRef('pk')).values('pk')
assigned_user_filter_none = Q(pk__in=Subquery(assigned_users_ids))
assigned_to_filter_none = Q(assigned_to__isnull=True)
return (self.get_assigned_users_filter(UserStoryModel, value)
| Q(assigned_user_filter_none, assigned_to_filter_none))
else:
return self.get_assigned_users_filter(UserStoryModel, value)
return None
class StatusesFilter(BaseRelatedFieldsFilter):
filter_name = 'status'
exclude_param_name = 'exclude_status'
class IssueTypesFilter(BaseRelatedFieldsFilter):
filter_name = 'type'
param_name = 'type'
exclude_param_name = 'exclude_type'
class PrioritiesFilter(BaseRelatedFieldsFilter):
filter_name = 'priority'
exclude_param_name = 'exclude_priority'
class SeveritiesFilter(BaseRelatedFieldsFilter):
filter_name = 'severity'
exclude_param_name = 'exclude_severity'
class TagsFilter(FilterBackend):
filter_name = 'tags'
exclude_param_name = 'exclude_tags'
def __init__(self, filter_name=None, exclude_param_name=None):
if filter_name:
self.filter_name = filter_name
if exclude_param_name:
self.exclude_param_name = exclude_param_name
def _get_tags_queryparams(self, params, mode=''):
param_name = self.exclude_param_name if mode == "exclude" else self.filter_name
tags = params.get(param_name, None)
if tags:
return tags.split(",")
return None
def _prepare_filter_query(self, query):
return Q(tags__contains=query)
def _prepare_exclude_query(self, tags):
queries = [Q(tags__contains=[tag]) for tag in tags]
query = queries.pop()
for item in queries:
query |= item
return ~Q(query)
def filter_queryset(self, request, queryset, view):
operations = {
"filter": self._prepare_filter_query,
"exclude": self._prepare_exclude_query,
}
for mode, prepare_method in operations.items():
query = self._get_tags_queryparams(request.QUERY_PARAMS, mode=mode)
if query:
queryset = queryset.filter(prepare_method(query))
return super().filter_queryset(request, queryset, view)
class WatchersFilter(FilterBackend):
filter_name = 'watchers'
def __init__(self, filter_name=None):
if filter_name:
self.filter_name = filter_name
def _get_watchers_queryparams(self, params):
watchers = params.get(self.filter_name, None)
if watchers:
return watchers.split(",")
return None
def filter_queryset(self, request, queryset, view):
query_watchers = self._get_watchers_queryparams(request.QUERY_PARAMS)
if query_watchers:
WatchedModel = apps.get_model("notifications", "Watched")
watched_type = ContentType.objects.get_for_model(queryset.model)
try:
watched_ids = (WatchedModel.objects.filter(content_type=watched_type,
user__id__in=query_watchers)
.values_list("object_id", flat=True))
queryset = queryset.filter(id__in=watched_ids)
except ValueError:
raise exc.BadRequest(_("Error in filter params types."))
return super().filter_queryset(request, queryset, view)
class BaseCompareFilter(FilterBackend):
operators = ["", "lt", "gt", "lte", "gte"]
def __init__(self, filter_name_base=None, operators=None):
if filter_name_base:
self.filter_name_base = filter_name_base
def _get_filter_names(self):
return [
self._get_filter_name(operator)
for operator in self.operators
]
def _get_filter_name(self, operator):
if operator and len(operator) > 0:
return "{base}__{operator}".format(
base=self.filter_name_base, operator=operator
)
else:
return self.filter_name_base
def _get_constraints(self, params):
constraints = {}
for filter_name in self._get_filter_names():
raw_value = params.get(filter_name, None)
if raw_value is not None:
constraints[filter_name] = self._get_value(raw_value)
return constraints
def _get_value(self, raw_value):
return raw_value
def filter_queryset(self, request, queryset, view):
constraints = self._get_constraints(request.QUERY_PARAMS)
if len(constraints) > 0:
queryset = queryset.filter(**constraints)
return super().filter_queryset(request, queryset, view)
class BaseDateFilter(BaseCompareFilter):
def _get_value(self, raw_value):
return parse_date(raw_value)
class CreatedDateFilter(BaseDateFilter):
filter_name_base = "created_date"
class ModifiedDateFilter(BaseDateFilter):
filter_name_base = "modified_date"
class FinishedDateFilter(BaseDateFilter):
filter_name_base = "finished_date"
class FinishDateFilter(BaseDateFilter):
filter_name_base = "finish_date"
class EstimatedStartFilter(BaseDateFilter):
filter_name_base = "estimated_start"
class EstimatedFinishFilter(BaseDateFilter):
filter_name_base = "estimated_finish"
class MilestoneEstimatedStartFilter(BaseDateFilter):
filter_name_base = "milestone__estimated_start"
class MilestoneEstimatedFinishFilter(BaseDateFilter):
filter_name_base = "milestone__estimated_finish"
#####################################################################
# Text search filters
#####################################################################
class QFilter(FilterBackend): class QFilter(FilterBackend):
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):
q = request.QUERY_PARAMS.get('q', None) q = request.QUERY_PARAMS.get('q', None)
if q: if q:
qs_args = [Q(subject__icontains=x) for x in q.split()] table = queryset.model._meta.db_table
qs_args += [Q(ref=x) for x in q.split() if x.isdigit()] where_clause = ("""
queryset = queryset.filter(reduce(operator.or_, qs_args)) to_tsvector('simple',
coalesce({table}.subject, '') || ' ' ||
coalesce(array_to_string({table}.tags, ' '), '') || ' ' ||
coalesce({table}.ref) || ' ' ||
coalesce({table}.description, '')) @@ to_tsquery('simple', %s)
""".format(table=table))
queryset = queryset.extra(where=[where_clause], params=[to_tsquery(q)])
return queryset return queryset
class RoleFilter(BaseRelatedFieldsFilter):
filter_name = "role_id"
param_name = "role"
exclude_param_name = "exclude_role"
def filter_queryset(self, request, queryset, view):
Membership = apps.get_model('projects', 'Membership')
operations = {
"filter": self._prepare_filter_query,
"exclude": self._prepare_exclude_query,
}
for mode, qs_method in operations.items():
query = self._get_queryparams(request.QUERY_PARAMS, mode=mode)
if query:
memberships = Membership.objects.filter(query).exclude(user__isnull=True).values_list("user_id", flat=True)
if memberships:
queryset = queryset.filter(qs_method(Q(assigned_to__in=memberships)))
return FilterBackend.filter_queryset(self, request, queryset, view)
class UserStoriesRoleFilter(FilterModelAssignedUsers, BaseRelatedFieldsFilter):
filter_name = "role_id"
param_name = "role"
exclude_param_name = 'exclude_role'
def filter_queryset(self, request, queryset, view):
Membership = apps.get_model('projects', 'Membership')
operations = {
"filter": self._prepare_filter_query,
"exclude": self._prepare_exclude_query,
}
for mode, qs_method in operations.items():
query = self._get_queryparams(request.QUERY_PARAMS, mode=mode)
if query:
memberships = Membership.objects.filter(query).exclude(user__isnull=True).values_list("user_id", flat=True)
if memberships:
user_story_model = apps.get_model("userstories", "UserStory")
queryset = queryset.filter(
qs_method(Q(self.get_assigned_users_filter(user_story_model, memberships)))
)
return FilterBackend.filter_queryset(self, request, queryset, view)

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the

44
taiga/base/mails.py Normal file
View File

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.conf import settings
from djmail import template_mail
import premailer
import logging
# Hide CSS warnings messages if debug mode is disable
if not getattr(settings, "DEBUG", False):
premailer.premailer.cssutils.log.setLevel(logging.CRITICAL)
class InlineCSSTemplateMail(template_mail.TemplateMail):
def _render_message_body_as_html(self, context):
html = super()._render_message_body_as_html(context)
# Transform CSS into line style attributes
return premailer.transform(html)
class MagicMailBuilder(template_mail.MagicMailBuilder):
pass
mail_builder = MagicMailBuilder(template_mail_cls=InlineCSSTemplateMail)

View File

View File

@ -0,0 +1,283 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
from django.apps import apps
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.utils import timezone
from taiga.base.mails import InlineCSSTemplateMail
from taiga.base.mails import mail_builder
from taiga.projects.models import Project, Membership
from taiga.projects.history.models import HistoryEntry
from taiga.projects.history.services import get_history_queryset_by_model_instance
from taiga.users.services import get_user_photo_url
from taiga.front.templatetags.functions import resolve as resolve_front_url
class Command(BaseCommand):
help = 'Send an example of all emails'
def add_arguments(self, parser):
parser.add_argument('--locale', '-l',
default=None,
dest='locale',
help='Send emails in an specific language.')
parser.add_argument('email',
help='Emeil address to send sample emails.')
def handle(self, *args, **options):
locale = options.get('locale')
email_address = options.get('email')
# Register email
context = {"lang": locale,
"user": get_user_model().objects.all().order_by("?").first(),
"cancel_token": "cancel-token"}
email = mail_builder.registered_user(email_address, context)
email.send()
# Membership invitation
membership = Membership.objects.order_by("?").filter(user__isnull=True).first()
membership.invited_by = get_user_model().objects.all().order_by("?").first()
membership.invitation_extra_text = "Text example, Text example,\nText example,\n\nText example"
context = {"lang": locale, "membership": membership}
email = mail_builder.membership_invitation(email_address, context)
email.send()
# Membership notification
context = {"lang": locale,
"membership": Membership.objects.order_by("?").filter(user__isnull=False).first()}
email = mail_builder.membership_notification(email_address, context)
email.send()
# Feedback
context = {
"lang": locale,
"feedback_entry": {
"full_name": "Test full name",
"email": "test@email.com",
"comment": "Test comment",
},
"extra": {
"key1": "value1",
"key2": "value2",
},
}
email = mail_builder.feedback_notification(email_address, context)
email.send()
# Password recovery
context = {"lang": locale, "user": get_user_model().objects.all().order_by("?").first()}
email = mail_builder.password_recovery(email_address, context)
email.send()
# Change email
context = {"lang": locale, "user": get_user_model().objects.all().order_by("?").first()}
email = mail_builder.change_email(email_address, context)
email.send()
# Export/Import emails
context = {
"lang": locale,
"user": get_user_model().objects.all().order_by("?").first(),
"project": Project.objects.all().order_by("?").first(),
"error_subject": "Error generating project dump",
"error_message": "Error generating project dump",
}
email = mail_builder.export_error(email_address, context)
email.send()
context = {
"lang": locale,
"user": get_user_model().objects.all().order_by("?").first(),
"error_subject": "Error importing project dump",
"error_message": "Error importing project dump",
}
email = mail_builder.import_error(email_address, context)
email.send()
deletion_date = timezone.now() + datetime.timedelta(seconds=60*60*24)
context = {
"lang": locale,
"url": "http://dummyurl.com",
"user": get_user_model().objects.all().order_by("?").first(),
"project": Project.objects.all().order_by("?").first(),
"deletion_date": deletion_date,
}
email = mail_builder.dump_project(email_address, context)
email.send()
context = {
"lang": locale,
"user": get_user_model().objects.all().order_by("?").first(),
"project": Project.objects.all().order_by("?").first(),
}
email = mail_builder.load_dump(email_address, context)
email.send()
# Notification emails
notification_emails = [
("issues.Issue", "issues/issue-change"),
("issues.Issue", "issues/issue-create"),
("issues.Issue", "issues/issue-delete"),
("tasks.Task", "tasks/task-change"),
("tasks.Task", "tasks/task-create"),
("tasks.Task", "tasks/task-delete"),
("userstories.UserStory", "userstories/userstory-change"),
("userstories.UserStory", "userstories/userstory-create"),
("userstories.UserStory", "userstories/userstory-delete"),
("milestones.Milestone", "milestones/milestone-change"),
("milestones.Milestone", "milestones/milestone-create"),
("milestones.Milestone", "milestones/milestone-delete"),
("wiki.WikiPage", "wiki/wikipage-change"),
("wiki.WikiPage", "wiki/wikipage-create"),
("wiki.WikiPage", "wiki/wikipage-delete"),
]
context = {
"lang": locale,
"project": Project.objects.all().order_by("?").first(),
"changer": get_user_model().objects.all().order_by("?").first(),
"history_entries": HistoryEntry.objects.all().order_by("?")[0:5],
"user": get_user_model().objects.all().order_by("?").first(),
}
for notification_email in notification_emails:
model = apps.get_model(*notification_email[0].split("."))
snapshot = {
"subject": "Tests subject",
"ref": 123123,
"name": "Tests name",
"slug": "test-slug"
}
queryset = model.objects.all().order_by("?")
for obj in queryset:
end = False
entries = get_history_queryset_by_model_instance(obj).filter(is_snapshot=True).order_by("?")
for entry in entries:
if entry.snapshot:
snapshot = entry.snapshot
end = True
break
if end:
break
context["snapshot"] = snapshot
cls = type("InlineCSSTemplateMail", (InlineCSSTemplateMail,), {"name": notification_email[1]})
email = cls()
email.send(email_address, context)
# Transfer Emails
context = {
"project": Project.objects.all().order_by("?").first(),
"requester": get_user_model().objects.all().order_by("?").first(),
}
email = mail_builder.transfer_request(email_address, context)
email.send()
context = {
"project": Project.objects.all().order_by("?").first(),
"receiver": get_user_model().objects.all().order_by("?").first(),
"token": "test-token",
"reason": "Test reason"
}
email = mail_builder.transfer_start(email_address, context)
email.send()
context = {
"project": Project.objects.all().order_by("?").first(),
"old_owner": get_user_model().objects.all().order_by("?").first(),
"new_owner": get_user_model().objects.all().order_by("?").first(),
"reason": "Test reason"
}
email = mail_builder.transfer_accept(email_address, context)
email.send()
context = {
"project": Project.objects.all().order_by("?").first(),
"rejecter": get_user_model().objects.all().order_by("?").first(),
"reason": "Test reason"
}
email = mail_builder.transfer_reject(email_address, context)
email.send()
# Contact with project admins email
project = Project.objects.all().order_by("?").first()
user = get_user_model().objects.all().order_by("?").first()
context = {
"full_name": user.get_full_name(),
"project_name": project.name,
"photo_url": get_user_photo_url(user),
"user_profile_url": resolve_front_url("user", user.username),
"project_settings_url": resolve_front_url("project-admin", project.slug),
"comment": "Test comment notification."
}
email = mail_builder.contact_notification(email_address, context)
email.send()
# GitHub importer email
context = {
"project": Project.objects.all().order_by("?").first(),
"user": get_user_model().objects.all().order_by("?").first()
}
email = mail_builder.github_import_success(email_address, context)
email.send()
# Jira importer email
context = {
"project": Project.objects.all().order_by("?").first(),
"user": get_user_model().objects.all().order_by("?").first()
}
email = mail_builder.jira_import_success(email_address, context)
email.send()
# Trello importer email
context = {
"project": Project.objects.all().order_by("?").first(),
"user": get_user_model().objects.all().order_by("?").first()
}
email = mail_builder.trello_import_success(email_address, context)
email.send()
# Asana importer email
context = {
"project": Project.objects.all().order_by("?").first(),
"user": get_user_model().objects.all().order_by("?").first()
}
email = mail_builder.asana_import_success(email_address, context)
email.send()
# Error importer email
context = {
"user": get_user_model().objects.all().order_by("?").first(),
"error_subject": "Error importing GitHub project",
"error_message": "Error importing GitHub project",
"project": 1234,
"exception": "Exception message"
}
email = mail_builder.importer_import_error(email_address, context)
email.send()

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -14,29 +16,30 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
from django import http from django import http
from django.conf import settings
COORS_ALLOWED_ORIGINS = "*" COORS_ALLOWED_ORIGINS = "*"
COORS_ALLOWED_METHODS = ["POST", "GET", "OPTIONS", "PUT", "DELETE", "PATCH", "HEAD"] COORS_ALLOWED_METHODS = ["POST", "GET", "OPTIONS", "PUT", "DELETE", "PATCH", "HEAD"]
COORS_ALLOWED_HEADERS = ["content-type", "x-requested-with", COORS_ALLOWED_HEADERS = ["content-type", "x-requested-with",
"authorization", "accept-encoding", "authorization", "accept-encoding",
"x-disable-pagination", "x-host", "x-disable-pagination", "x-lazy-pagination",
"x-session-id"] "x-host", "x-session-id", "set-orders"]
COORS_ALLOWED_CREDENTIALS = True COORS_ALLOWED_CREDENTIALS = True
COORS_EXPOSE_HEADERS = ["x-pagination-count", "x-paginated", "x-paginated-by", COORS_EXPOSE_HEADERS = ["x-pagination-count", "x-paginated", "x-paginated-by",
"x-paginated-by", "x-pagination-current", "x-site-host", "x-pagination-current", "x-pagination-next", "x-pagination-prev",
"x-site-register"] "x-site-host", "x-site-register"]
COORS_EXTRA_EXPOSE_HEADERS = getattr(settings, "APP_EXTRA_EXPOSE_HEADERS", [])
class CoorsMiddleware(object): class CoorsMiddleware(object):
def _populate_response(self, response): def _populate_response(self, response):
response["Access-Control-Allow-Origin"] = COORS_ALLOWED_ORIGINS response["Access-Control-Allow-Origin"] = COORS_ALLOWED_ORIGINS
response["Access-Control-Allow-Methods"] = ",".join(COORS_ALLOWED_METHODS) response["Access-Control-Allow-Methods"] = ",".join(COORS_ALLOWED_METHODS)
response["Access-Control-Allow-Headers"] = ",".join(COORS_ALLOWED_HEADERS) response["Access-Control-Allow-Headers"] = ",".join(COORS_ALLOWED_HEADERS)
response["Access-Control-Expose-Headers"] = ",".join(COORS_EXPOSE_HEADERS) response["Access-Control-Expose-Headers"] = ",".join(COORS_EXPOSE_HEADERS + COORS_EXTRA_EXPOSE_HEADERS)
response["Access-Control-Max-Age"] = "3600" response["Access-Control-Max-Age"] = "3600"
if COORS_ALLOWED_CREDENTIALS: if COORS_ALLOWED_CREDENTIALS:

View File

@ -1,50 +0,0 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import sys
def patch_serializer():
from rest_framework import serializers
if hasattr(serializers.BaseSerializer, "_patched"):
return
def to_native(self, obj):
"""
Serialize objects -> primitives.
"""
ret = self._dict_class()
ret.fields = self._dict_class()
ret.empty = obj is None
for field_name, field in self.fields.items():
field.initialize(parent=self, field_name=field_name)
key = self.get_field_key(field_name)
ret.fields[key] = field
if obj is not None:
value = field.field_to_native(obj, field_name)
ret[key] = value
return ret
serializers.BaseSerializer._patched = True
serializers.BaseSerializer.to_native = to_native
def patch_restframework():
from rest_framework import fields
fields.strip_multiple_choice_msg = lambda x: x

View File

@ -1,7 +1,9 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -15,67 +17,17 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from functools import partial
from collections import namedtuple from collections import namedtuple
from django.db.models import Q from django.db import connection
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.sql.datastructures import EmptyResultSet
from taiga.base.api import serializers
from taiga.base.fields import Field, MethodField
Neighbor = namedtuple("Neighbor", "left right") Neighbor = namedtuple("Neighbor", "left right")
def disjunction_filters(filters):
"""From a list of queryset filters, it returns a disjunction (OR) Q object.
:param filters: List of filters where each item is a dict where the keys are the lookups and
the values the values of those lookups.
:return: :class:`django.db.models.Q` instance representing the disjunction of the filters.
"""
result = Q()
for filter in filters:
result |= Q(**{lookup: value for lookup, value in filter.items()})
return result
def get_attribute(obj, attr):
"""Finds `attr` in obj.
:param obj: Object where to look for the attribute.
:param attr: Attribute name as a string. It can be a Django lookup field such as
`project__owner__name`, in which case it will look for `obj.project.owner.name`.
:return: The attribute value.
:raises: `AttributeError` if some attribute doesn't exist.
"""
chunks = attr.lstrip("-").split("__")
attr, chunks = chunks[0], chunks[1:]
obj = value = getattr(obj, attr)
for path in chunks:
value = getattr(obj, path)
obj = value
return value
def transform_field_into_lookup(name, value, operator="", operator_if_desc=""):
"""From a field name and value, return a dict that may be used as a queryset filter.
:param name: Field name as a string.
:param value: Field value.
:param operator: Operator to use in the lookup.
:param operator_if_desc: If the field is reversed (a "-" in front) use this operator
instead.
:return: A dict that may be used as a queryset filter.
"""
if name.startswith("-"):
name = name[1:]
operator = operator_if_desc
lookup = "{}{}".format(name, operator)
return {lookup: value}
def get_neighbors(obj, results_set=None): def get_neighbors(obj, results_set=None):
"""Get the neighbors of a model instance. """Get the neighbors of a model instance.
@ -89,51 +41,76 @@ def get_neighbors(obj, results_set=None):
""" """
if results_set is None: if results_set is None:
results_set = type(obj).objects.get_queryset() results_set = type(obj).objects.get_queryset()
# Neighbors calculation is at least at project level
results_set = results_set.filter(project_id=obj.project.id)
compiler = results_set.query.get_compiler('default')
try: try:
left = _left_candidates(obj, results_set).reverse()[0] base_sql, base_params = compiler.as_sql(with_col_aliases=True)
except IndexError: except EmptyResultSet:
# Generate a not empty queryset
results_set = type(obj).objects.get_queryset().filter(project_id=obj.project.id)
compiler = results_set.query.get_compiler('default')
base_sql, base_params = compiler.as_sql(with_col_aliases=True)
query = """
SELECT * FROM
(SELECT "col1" as id,
ROW_NUMBER() OVER(),
LAG("col1", 1) OVER() AS prev,
LEAD("col1", 1) OVER() AS next
FROM (%s) as ID_AND_ROW)
AS SELECTED_ID_AND_ROW
""" % (base_sql)
query += " WHERE id=%s;"
params = list(base_params) + [obj.id]
cursor = connection.cursor()
cursor.execute(query, params)
row = cursor.fetchone()
if row is None:
return Neighbor(None, None)
left_object_id = row[2]
right_object_id = row[3]
try:
left = results_set.get(id=left_object_id)
except ObjectDoesNotExist:
left = None left = None
try: try:
right = _right_candidates(obj, results_set)[0] right = results_set.get(id=right_object_id)
except IndexError: except ObjectDoesNotExist:
right = None right = None
return Neighbor(left, right) return Neighbor(left, right)
def _get_candidates(obj, results_set, reverse=False): class NeighborSerializer(serializers.LightSerializer):
ordering = (results_set.query.order_by or []) + list(obj._meta.ordering) id = Field()
main_ordering, rest_ordering = ordering[0], ordering[1:] ref = Field()
try: subject = Field()
filters = obj.get_neighbors_additional_filters(results_set, ordering, reverse)
if filters is None:
raise AttributeError
except AttributeError:
filters = [order_field_as_filter(obj, main_ordering, reverse)]
filters += [ordering_fields_as_filter(obj, main_ordering, rest_ordering, reverse)]
return (results_set
.filter(~Q(id=obj.id), disjunction_filters(filters))
.distinct()
.order_by(*ordering))
_left_candidates = partial(_get_candidates, reverse=True)
_right_candidates = partial(_get_candidates, reverse=False)
def order_field_as_filter(obj, order_field, reverse=None, operator=None): class NeighborsSerializerMixin(serializers.LightSerializer):
value = get_attribute(obj, order_field) neighbors = MethodField()
if reverse is not None:
if operator is None:
operator = ("__gt", "__lt")
operator = (operator[1], operator[0]) if reverse else operator
else:
operator = ()
return transform_field_into_lookup(order_field, value, *operator)
def serialize_neighbor(self, neighbor):
if neighbor:
return NeighborSerializer(neighbor).data
return None
def ordering_fields_as_filter(obj, main_order_field, ordering_fields, reverse=False): def get_neighbors(self, obj):
"""Transform a list of ordering fields into a queryset filter.""" view, request = self.context.get("view", None), self.context.get("request", None)
filter = order_field_as_filter(obj, main_order_field) if view and request:
for field in ordering_fields: queryset = view.filter_queryset(view.get_queryset())
filter.update(order_field_as_filter(obj, field, reverse, ("__gte", "__lte"))) left, right = get_neighbors(obj, results_set=queryset)
return filter else:
left = right = None
return {
"previous": self.serialize_neighbor(left),
"next": self.serialize_neighbor(right)
}

View File

@ -1,7 +1,9 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -15,17 +17,116 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# The code is partially taken (and modified) from django rest framework
# that is licensed under the following terms:
#
# Copyright (c) 2011-2014, Tom Christie
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""The various HTTP responses for use in returning proper HTTP codes.""" """The various HTTP responses for use in returning proper HTTP codes."""
from http.client import responses
from django import http from django import http
import rest_framework.response from django.template.response import SimpleTemplateResponse
from django.utils import six
class Response(rest_framework.response.Response): class Response(SimpleTemplateResponse):
def __init__(self, data=None, status=None, template_name=None, headers=None, exception=False, """
content_type=None): An HttpResponse that allows its data to be rendered into
super(Response, self).__init__(data, status, template_name, headers, exception, arbitrary media types.
content_type) """
def __init__(self, data=None, status=None,
template_name=None, headers=None,
exception=False, content_type=None):
"""
Alters the init arguments slightly.
For example, drop 'template_name', and instead use 'data'.
Setting 'renderer' and 'media_type' will typically be deferred,
For example being set automatically by the `APIView`.
"""
super().__init__(None, status=status)
self.data = data
self.template_name = template_name
self.exception = exception
self.content_type = content_type
if headers:
for name, value in six.iteritems(headers):
self[name] = value
@property
def rendered_content(self):
renderer = getattr(self, "accepted_renderer", None)
media_type = getattr(self, "accepted_media_type", None)
context = getattr(self, "renderer_context", None)
assert renderer, ".accepted_renderer not set on Response"
assert media_type, ".accepted_media_type not set on Response"
assert context, ".renderer_context not set on Response"
context["response"] = self
charset = renderer.charset
content_type = self.content_type
if content_type is None and charset is not None:
content_type = "{0}; charset={1}".format(media_type, charset)
elif content_type is None:
content_type = media_type
self["Content-Type"] = content_type
ret = renderer.render(self.data, media_type, context)
if isinstance(ret, six.text_type):
assert charset, "renderer returned unicode, and did not specify " \
"a charset value."
return bytes(ret.encode(charset))
if not ret:
del self["Content-Type"]
return ret
@property
def status_text(self):
"""
Returns reason text corresponding to our HTTP response status code.
Provided for convenience.
"""
# TODO: Deprecate and use a template tag instead
# TODO: Status code text for RFC 6585 status codes
return responses.get(self.status_code, '')
def __getstate__(self):
"""
Remove attributes from the response that shouldn't be cached
"""
state = super().__getstate__()
for key in ("accepted_renderer", "renderer_context", "data"):
if key in state:
del state[key]
return state
class Ok(Response): class Ok(Response):

View File

@ -1,6 +1,8 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # -*- coding: utf-8 -*-
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
@ -18,14 +20,14 @@
import itertools import itertools
from collections import namedtuple from collections import namedtuple
from django.conf.urls import patterns, url from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import NoReverseMatch
from rest_framework import views from taiga.base.api import views
from rest_framework.response import Response from taiga.base import response
from rest_framework.reverse import reverse from taiga.base.api.reverse import reverse
from rest_framework.urlpatterns import format_suffix_patterns from taiga.base.api.urlpatterns import format_suffix_patterns
Route = namedtuple('Route', ['url', 'mapping', 'name', 'initkwargs']) Route = namedtuple('Route', ['url', 'mapping', 'name', 'initkwargs'])
@ -77,7 +79,7 @@ class BaseRouter(object):
@property @property
def urls(self): def urls(self):
if not hasattr(self, '_urls'): if not hasattr(self, '_urls'):
self._urls = patterns('', *self.get_urls()) self._urls = self.get_urls()
return self._urls return self._urls
@ -292,7 +294,7 @@ class DRFDefaultRouter(SimpleRouter):
except NoReverseMatch: except NoReverseMatch:
# Support resources that are prefixed by a parametrized url # Support resources that are prefixed by a parametrized url
ret[key] = request.build_absolute_uri() + key ret[key] = request.build_absolute_uri() + key
return Response(ret) return response.Response(ret)
return APIRoot.as_view() return APIRoot.as_view()
@ -316,7 +318,58 @@ class DRFDefaultRouter(SimpleRouter):
return urls return urls
class DefaultRouter(DRFDefaultRouter): class NestedRegistryItem(object):
def __init__(self, router, parent_prefix, parent_item=None):
self.router = router
self.parent_prefix = parent_prefix
self.parent_item = parent_item
def register(self, prefix, viewset, base_name, parents_query_lookups):
self.router._register(
prefix=self.get_prefix(current_prefix=prefix, parents_query_lookups=parents_query_lookups),
viewset=viewset,
base_name=base_name,
)
return NestedRegistryItem(
router=self.router,
parent_prefix=prefix,
parent_item=self
)
def get_prefix(self, current_prefix, parents_query_lookups):
return "{0}/{1}".format(
self.get_parent_prefix(parents_query_lookups),
current_prefix
)
def get_parent_prefix(self, parents_query_lookups):
prefix = "/"
current_item = self
i = len(parents_query_lookups) - 1
while current_item:
prefix = "{parent_prefix}/(?P<{parent_pk_kwarg_name}>[^/.]+)/{prefix}".format(
parent_prefix=current_item.parent_prefix,
parent_pk_kwarg_name=parents_query_lookups[i],
prefix=prefix
)
i -= 1
current_item = current_item.parent_item
return prefix.strip("/")
class NestedRouterMixin:
def _register(self, *args, **kwargs):
return super().register(*args, **kwargs)
def register(self, *args, **kwargs):
self._register(*args, **kwargs)
return NestedRegistryItem(
router=self,
parent_prefix=self.registry[-1][0]
)
class DefaultRouter(NestedRouterMixin, DRFDefaultRouter):
pass pass
__all__ = ["DefaultRouter"] __all__ = ["DefaultRouter"]

View File

@ -1,142 +0,0 @@
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.forms import widgets
from rest_framework import serializers
from .neighbors import get_neighbors
class PickleField(serializers.WritableField):
"""
Pickle objects serializer.
"""
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class JsonField(serializers.WritableField):
"""
Json objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class PgArrayField(serializers.WritableField):
"""
PgArray objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return obj
def from_native(self, data):
return data
class TagsColorsField(serializers.WritableField):
"""
PgArray objects serializer.
"""
widget = widgets.Textarea
def to_native(self, obj):
return dict(obj)
def from_native(self, data):
return list(data.items())
class NeighborsSerializerMixin:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["neighbors"] = serializers.SerializerMethodField("get_neighbors")
def serialize_neighbor(self, neighbor):
raise NotImplementedError
def get_neighbors(self, obj):
view, request = self.context.get("view", None), self.context.get("request", None)
if view and request:
queryset = view.filter_queryset(view.get_queryset())
left, right = get_neighbors(obj, results_set=queryset)
else:
left = right = None
return {
"previous": self.serialize_neighbor(left),
"next": self.serialize_neighbor(right)
}
class Serializer(serializers.Serializer):
def skip_field_validation(self, field, attrs, source):
return source not in attrs and (field.partial or not field.required)
def perform_validation(self, attrs):
"""
Run `validate_<fieldname>()` and `validate()` methods on the serializer
"""
for field_name, field in self.fields.items():
if field_name in self._errors:
continue
source = field.source or field_name
if self.skip_field_validation(field, attrs, source):
continue
try:
validate_method = getattr(self, 'validate_%s' % field_name, None)
if validate_method:
attrs = validate_method(attrs, source)
except serializers.ValidationError as err:
self._errors[field_name] = self._errors.get(field_name, []) + list(err.messages)
# If there are already errors, we don't run .validate() because
# field-validation failed and thus `attrs` may not be complete.
# which in turn can cause inconsistent validation errors.
if not self._errors:
try:
attrs = self.validate(attrs)
except serializers.ValidationError as err:
if hasattr(err, 'message_dict'):
for field_name, error_messages in err.message_dict.items():
self._errors[field_name] = self._errors.get(field_name, []) + list(error_messages)
elif hasattr(err, 'messages'):
self._errors['non_field_errors'] = err.messages
return attrs
class ModelSerializer(serializers.ModelSerializer):
def perform_validation(self, attrs):
for attr in attrs:
field = self.fields.get(attr, None)
if field:
field.required = True
return super().perform_validation(attrs)

View File

Some files were not shown because too many files have changed in this diff Show More