Compare commits
No commits in common. "master" and "3.3.0" have entirely different histories.
|
@ -1,7 +1,7 @@
|
|||
language: python
|
||||
python:
|
||||
- "3.4"
|
||||
- "3.5"
|
||||
- "3.6"
|
||||
addons:
|
||||
postgresql: "9.4"
|
||||
services:
|
||||
|
@ -17,9 +17,8 @@ before_install:
|
|||
- sudo /etc/init.d/postgresql start 9.4
|
||||
- psql -c 'create database taiga;' -U postgres
|
||||
install:
|
||||
- travis_retry pip install pipenv
|
||||
- travis_retry pipenv sync --dev
|
||||
- travis_retry pip install -r requirements-devel.txt
|
||||
script:
|
||||
- travis_retry pipenv run coverage run --source=taiga --omit='*tests*,*commands*,*migrations*,*admin*,*.jinja,*dashboard*,*settings*,*wsgi*,*questions*,*documents*' -m pytest -v --tb=native
|
||||
- travis_retry coverage run --source=taiga --omit='*tests*,*commands*,*migrations*,*admin*,*.jinja,*dashboard*,*settings*,*wsgi*,*questions*,*documents*' -m py.test -v --tb=native
|
||||
after_success:
|
||||
- coveralls
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = sr@latin:sr_Latn, zh_CN:zh_Hans, zh_TW:zh_Hant, fa_IR:fa
|
||||
lang_map = sr@latin:sr_Latn, zh_CN:zh_Hans, zh_TW:zh_Hant
|
||||
|
||||
[taiga-back.taiga]
|
||||
file_filter = taiga/locale/<lang>/LC_MESSAGES/django.po
|
||||
|
|
145
CHANGELOG.md
145
CHANGELOG.md
|
@ -2,151 +2,6 @@
|
|||
|
||||
## 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
|
||||
|
|
137
CONTRIBUTING.md
137
CONTRIBUTING.md
|
@ -1,122 +1,77 @@
|
|||
# How can I contribute to Taiga?
|
||||
# Contributing
|
||||
|
||||
---
|
||||
#### Where to start ####
|
||||
|
||||
## Developer Certificate of Origin + License
|
||||
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:
|
||||
|
||||
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.
|
||||
- **Code patches**
|
||||
- **Documentation improvements**
|
||||
- **Translations**
|
||||
- **Bug reports**
|
||||
- **Patch reviews**
|
||||
- **UI enhancements**
|
||||
|
||||
All Contributions are subject to the following DCO + License terms.
|
||||
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)
|
||||
|
||||
[DCO + License](https://github.com/taiga/taiga-back/blob/master/DCOLICENSE)
|
||||
|
||||
_This notice should stay as the first item in the CONTRIBUTING.md file._
|
||||
#### 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).
|
||||
|
||||
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
|
||||
#### License ####
|
||||
|
||||
Help us keep the Taiga Community open and inclusive. Please read and follow our [Code of Conduct][CoC].
|
||||
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.
|
||||
|
||||
## Our License
|
||||
Please read carefully [our license](https://github.com/taigaio/taiga-back/blob/master/LICENSE) and ask us if you have any questions.
|
||||
|
||||
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.
|
||||
#### Bug reports, enhancements and support ####
|
||||
|
||||
## Setup problems
|
||||
If you **need help to setup Taiga**, want to **talk about some cool enhancement** or you have **some questions**, please write us to our [mailing list](http://groups.google.com/d/forum/taigaio).
|
||||
|
||||
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].
|
||||
If you **find a bug** in Taiga you can always report it:
|
||||
|
||||
## Sent us your feedback or questions
|
||||
- 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**.
|
||||
|
||||
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].
|
||||
One of our fellow Taiga developers will search, find and hunt it as soon as possible.
|
||||
|
||||
Remember that you can find some help in our [support pages][Taiga User documentation].
|
||||
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.
|
||||
|
||||
## 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
|
||||
#### 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:
|
||||
|
||||
- [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.
|
||||
- **[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.
|
||||
|
||||
[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
|
||||
#### Translation ####
|
||||
|
||||
[Taiga Mailing List]: http://groups.google.co.uk/d/forum/taigaio
|
||||
[Support email]: mailto:support@taiga.io
|
||||
[Security email]: mailto:security@taiga.io
|
||||
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/signup/ "Help Taiga to trasnlatecontent")**
|
||||
|
||||
[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
|
||||
#### 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.
|
||||
|
||||
|
||||
[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
705
DCOLICENSE
|
@ -1,705 +0,0 @@
|
|||
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/>.
|
53
Pipfile
53
Pipfile
|
@ -1,53 +0,0 @@
|
|||
[[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"
|
|
@ -1,805 +0,0 @@
|
|||
{
|
||||
"_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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ Help us keep the Taiga Community open and inclusive. Please read and follow our
|
|||
|
||||
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).
|
||||
Please read carefully [our license](https://github.com/taigaio/taiga-back/blob/master/LICENSE) and ask us if you have any questions.
|
||||
|
||||
|
||||
#### Bug reports, enhancements and support ####
|
||||
|
@ -96,7 +96,7 @@ python manage.py loaddata initial_project_templates
|
|||
python manage.py sample_data
|
||||
```
|
||||
|
||||
**IMPORTANT: Taiga only runs with python 3.5+**
|
||||
**IMPORTANT: Taiga only runs with python 3.4+**
|
||||
|
||||
Initial auth data: admin/123123
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
[pytest]
|
||||
DJANGO_SETTINGS_MODULE = settings.testing
|
||||
filterwarnings =
|
||||
once
|
||||
ignore::django.utils.deprecation.RemovedInDjango20Warning
|
||||
ignore::DeprecationWarning:taiga.base.api.serializers
|
||||
python_paths = .
|
|
@ -0,0 +1,11 @@
|
|||
-r requirements.txt
|
||||
|
||||
coverage==4.4.1
|
||||
coveralls==1.1
|
||||
django-slowdown==0.0.1
|
||||
factory_boy==2.8.1
|
||||
py==1.4.34
|
||||
pytest-django==3.1.2
|
||||
pytest-pythonpath==0.7.1
|
||||
pytest==3.1.1
|
||||
transifex-client==0.12.4
|
|
@ -1,63 +1,43 @@
|
|||
-i https://pypi.org/simple
|
||||
amqp==2.3.2
|
||||
asana==0.6.7
|
||||
asn1crypto==0.24.0
|
||||
billiard==3.5.0.5
|
||||
bleach==2.1.4
|
||||
cairocffi==0.9.0
|
||||
cairosvg==2.0.3
|
||||
#djangorestframework==2.3.13 # It's not necessary since Taiga 1.7
|
||||
CairoSVG==2.0.3
|
||||
Django==1.11.2
|
||||
git+git://github.com/Python-Markdown/markdown.git@a4d4b61b5ce4a7dd96ddc13c66b8716d3ad8eb51 # This version solves 'infinite execution' and other issues.
|
||||
Pillow==4.1.1
|
||||
PyJWT==1.5.0
|
||||
Unidecode==0.4.20
|
||||
amqp==2.1.4
|
||||
asana==0.6.5
|
||||
bleach==2.0.0
|
||||
celery==4.0.2
|
||||
certifi==2018.11.29
|
||||
cffi==1.11.5
|
||||
chardet==3.0.4
|
||||
contextlib2==0.5.5
|
||||
cryptography==2.3.1
|
||||
cssselect==1.0.3
|
||||
cryptography==1.9
|
||||
cssutils==1.0.2
|
||||
diff-match-patch==20121119
|
||||
django-ipware==1.1.6
|
||||
django-jinja==2.3.1
|
||||
django-pglocks==1.0.2
|
||||
django-picklefield==0.3.2
|
||||
django-sampledatahelper==0.4.1
|
||||
django-sites==0.9
|
||||
django-sr==0.0.4
|
||||
django==1.11.16
|
||||
djmail==1.0.1
|
||||
docopt==0.6.2
|
||||
easy-thumbnails==2.4.1
|
||||
fn==0.4.3
|
||||
git+https://github.com/Xof/django-pglocks.git
|
||||
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
|
||||
jinja2==2.9.6
|
||||
lxml==3.8.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
|
||||
psycopg2==2.7.1
|
||||
pygments==2.2.0
|
||||
pyjwt==1.7.0
|
||||
python-dateutil==2.7.5
|
||||
pyjwkest==1.3.2
|
||||
python-dateutil==2.6.0
|
||||
python-magic==0.4.13
|
||||
pytz==2018.7
|
||||
pytz==2017.2
|
||||
raven==6.1.0
|
||||
redis==2.10.5
|
||||
requests-oauthlib==0.8.0
|
||||
requests==2.20.0
|
||||
sampledata==0.3.7
|
||||
requests==2.17.3
|
||||
serpy==0.1.1
|
||||
six==1.11.0
|
||||
tinycss==0.4
|
||||
unidecode==0.4.20
|
||||
urllib3==1.24.1
|
||||
vine==1.1.4
|
||||
six==1.10.0
|
||||
webcolors==1.7
|
||||
webencodings==0.5.1
|
||||
|
|
|
@ -242,7 +242,11 @@ You need transifex-client, install it.
|
|||
|
||||
1. Install transifex-client, use
|
||||
|
||||
$ pip install --upgrade transifex-client
|
||||
$ pip install --upgrade -r requirements-devel.txt
|
||||
|
||||
or
|
||||
|
||||
$ pip install --upgrade transifex-client==0.12.2
|
||||
|
||||
2. Create ~/.transifexrc file:
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
from .celery import *
|
||||
|
||||
# To use celery in memory
|
||||
#task_always_eager = True
|
|
@ -95,7 +95,7 @@ LANGUAGES = [
|
|||
#("es-ve", "Español (Venezuela)"), # Venezuelan Spanish
|
||||
#("et", "Eesti"), # Estonian
|
||||
#("eu", "Euskara"), # Basque
|
||||
("fa", "فارسی"), # Persian
|
||||
#("fa", "فارسی"), # Persian
|
||||
("fi", "Suomi"), # Finnish
|
||||
("fr", "Français"), # French
|
||||
#("fy", "Frysk"), # Frisian
|
||||
|
@ -148,7 +148,7 @@ LANGUAGES = [
|
|||
("tr", "Türkçe"), # Turkish
|
||||
#("tt", "татар теле"), # Tatar
|
||||
#("udm", "удмурт кыл"), # Udmurt
|
||||
("uk", "Українська"), # Ukrainian
|
||||
#("uk", "Українська"), # Ukrainian
|
||||
#("ur", "اردو"), # Urdu
|
||||
#("vi", "Tiếng Việt"), # Vietnamese
|
||||
("zh-hans", "中文(简体)"), # Simplified Chinese
|
||||
|
@ -309,7 +309,6 @@ INSTALLED_APPS = [
|
|||
"taiga.projects.issues",
|
||||
"taiga.projects.wiki",
|
||||
"taiga.projects.contact",
|
||||
"taiga.projects.settings",
|
||||
"taiga.searches",
|
||||
"taiga.timeline",
|
||||
"taiga.mdrender",
|
||||
|
@ -548,7 +547,6 @@ 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
|
||||
|
|
|
@ -16,13 +16,12 @@
|
|||
# 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.api.permissions import (TaigaResourcePermission, IsAuthenticated)
|
||||
from .testing import *
|
||||
|
||||
|
||||
class UserProjectSettingsPermission(TaigaResourcePermission):
|
||||
retrieve_perms = IsAuthenticated()
|
||||
create_perms = IsAuthenticated()
|
||||
update_perms = IsAuthenticated()
|
||||
partial_update_perms = IsAuthenticated()
|
||||
destroy_perms = IsAuthenticated()
|
||||
list_perms = IsAuthenticated()
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'taiga',
|
||||
'USERNAME': 'postgres',
|
||||
}
|
||||
}
|
|
@ -2,10 +2,7 @@
|
|||
ignore = E41,E266
|
||||
max-line-length = 120
|
||||
exclude =
|
||||
.cache,
|
||||
.git,
|
||||
.tox,
|
||||
.venv,
|
||||
*__pycache__*,
|
||||
*tests*,
|
||||
*scripts*,
|
||||
|
|
|
@ -17,10 +17,13 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from functools import partial
|
||||
from enum import Enum
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.conf import settings
|
||||
|
||||
from taiga.base.api import validators
|
||||
from taiga.base.api import serializers
|
||||
from taiga.base.api import viewsets
|
||||
from taiga.base.decorators import list_route
|
||||
from taiga.base import exceptions as exc
|
||||
|
@ -88,10 +91,6 @@ class AuthViewSet(viewsets.ViewSet):
|
|||
|
||||
@list_route(methods=["POST"])
|
||||
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)
|
||||
|
||||
type = request.DATA.get("type", None)
|
||||
|
|
|
@ -115,8 +115,7 @@ def public_register(username:str, password:str, email:str, full_name:str):
|
|||
user_model = get_user_model()
|
||||
user = user_model(username=username,
|
||||
email=email,
|
||||
full_name=full_name,
|
||||
read_new_terms=True)
|
||||
full_name=full_name)
|
||||
user.set_password(password)
|
||||
try:
|
||||
user.save()
|
||||
|
|
|
@ -22,7 +22,7 @@ from dateutil.parser import parse as parse_date
|
|||
|
||||
from django.apps import apps
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db.models import Q, OuterRef, Subquery
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from taiga.base import exceptions as exc
|
||||
|
@ -140,17 +140,6 @@ class FilterBackend(OrderByFilterMixin):
|
|||
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
|
||||
#####################################################################
|
||||
|
@ -375,18 +364,14 @@ class IsProjectAdminFromWebhookLogFilterBackend(FilterBackend, BaseIsProjectAdmi
|
|||
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):
|
||||
def __init__(self, filter_name=None, 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:
|
||||
|
@ -400,139 +385,75 @@ class BaseRelatedFieldsFilter(FilterBackend):
|
|||
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
|
||||
def _get_queryparams(self, params):
|
||||
param_name = 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 {"{}__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)
|
||||
query = self._get_queryparams(request.QUERY_PARAMS)
|
||||
if query:
|
||||
queryset = queryset.filter(prepare_method(query))
|
||||
if isinstance(query, dict):
|
||||
queryset = queryset.filter(**query)
|
||||
else:
|
||||
queryset = queryset.filter(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):
|
||||
def __init__(self, filter_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)
|
||||
def _get_tags_queryparams(self, params):
|
||||
tags = params.get(self.filter_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))
|
||||
query_tags = self._get_tags_queryparams(request.QUERY_PARAMS)
|
||||
if query_tags:
|
||||
queryset = queryset.filter(tags__contains=query_tags)
|
||||
|
||||
return super().filter_queryset(request, queryset, view)
|
||||
|
||||
|
@ -671,47 +592,17 @@ class QFilter(FilterBackend):
|
|||
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)
|
||||
query = self._get_queryparams(request.QUERY_PARAMS)
|
||||
if query:
|
||||
memberships = Membership.objects.filter(query).exclude(user__isnull=True).values_list("user_id", flat=True)
|
||||
if isinstance(query, dict):
|
||||
memberships = Membership.objects.filter(**query).values_list("user_id", flat=True)
|
||||
queryset = queryset.filter(assigned_to__in=memberships)
|
||||
else:
|
||||
memberships = Membership.objects.filter(query).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)))
|
||||
)
|
||||
queryset = queryset.filter(assigned_to__in=memberships)
|
||||
|
||||
return FilterBackend.filter_queryset(self, request, queryset, view)
|
||||
|
|
|
@ -68,7 +68,7 @@ def psd_image_factory(data, *args):
|
|||
Image.register_open("PSD", psd_image_factory)
|
||||
|
||||
|
||||
def get_thumbnail(file_obj, thumbnailer_size):
|
||||
def get_thumbnail_url(file_obj, thumbnailer_size):
|
||||
# Ugly hack to temporary ignore tiff files
|
||||
relative_name = file_obj
|
||||
if isinstance(file_obj, FieldFile):
|
||||
|
@ -79,18 +79,9 @@ def get_thumbnail(file_obj, thumbnailer_size):
|
|||
return None
|
||||
|
||||
try:
|
||||
thumbnailer = get_thumbnailer(file_obj)
|
||||
return thumbnailer[thumbnailer_size]
|
||||
except InvalidImageFormatError:
|
||||
return None
|
||||
|
||||
|
||||
def get_thumbnail_url(file_obj, thumbnailer_size):
|
||||
thumbnail = get_thumbnail(file_obj, thumbnailer_size)
|
||||
|
||||
if not thumbnail:
|
||||
return None
|
||||
|
||||
path_url = thumbnail.url
|
||||
path_url = get_thumbnailer(file_obj)[thumbnailer_size].url
|
||||
thumb_url = get_absolute_url(path_url)
|
||||
except InvalidImageFormatError:
|
||||
thumb_url = None
|
||||
|
||||
return thumb_url
|
||||
|
|
|
@ -17,13 +17,8 @@
|
|||
# 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 ipaddress
|
||||
import socket
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import django_sites as sites
|
||||
from django.core.urlresolvers import reverse as django_reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
URL_TEMPLATE = "{scheme}://{domain}/{path}"
|
||||
|
||||
|
@ -48,29 +43,3 @@ def get_absolute_url(path):
|
|||
def reverse(viewname, *args, **kwargs):
|
||||
"""Same behavior as django's reverse but uses django_sites to compute absolute url."""
|
||||
return get_absolute_url(django_reverse(viewname, *args, **kwargs))
|
||||
|
||||
|
||||
class HostnameException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class IpAddresValueError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def validate_private_url(url):
|
||||
host = urlparse(url).hostname
|
||||
port = urlparse(url).port
|
||||
|
||||
try:
|
||||
socket_args, *others = socket.getaddrinfo(host, port)
|
||||
except Exception:
|
||||
raise HostnameException(_("Host access error"))
|
||||
|
||||
destination_address = socket_args[4][0]
|
||||
try:
|
||||
ipa = ipaddress.ip_address(destination_address)
|
||||
except ValueError:
|
||||
raise IpAddresValueError(_("IP Address error"))
|
||||
if ipa.is_private:
|
||||
raise IpAddresValueError("Private IP Address not allowed")
|
||||
|
|
|
@ -91,22 +91,6 @@ def emit_event_for_model(obj, *, type:str="change", channel:str="events",
|
|||
sessionid=sessionid,
|
||||
data=data)
|
||||
|
||||
|
||||
def emit_event_for_user_notification(user_id,
|
||||
*,
|
||||
session_id: str=None,
|
||||
event_type: str=None,
|
||||
data: dict=None):
|
||||
"""
|
||||
Sends a user notification event.
|
||||
"""
|
||||
return emit_event(
|
||||
data,
|
||||
"web_notifications.{}".format(user_id),
|
||||
sessionid=session_id
|
||||
)
|
||||
|
||||
|
||||
def emit_live_notification_for_model(obj, user, history, *, type:str="change", channel:str="events",
|
||||
sessionid:str="not-existing"):
|
||||
"""
|
||||
|
|
|
@ -155,26 +155,14 @@ class ProjectImporterViewSet(mixins.ImportThrottlingPolicyMixin, CreateModelMixi
|
|||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"issue_statuses",
|
||||
validators.IssueStatusExportValidator,)
|
||||
if "issue_duedates" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"issue_duedates",
|
||||
validators.IssueDueDateExportValidator,)
|
||||
if "us_statuses" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"us_statuses",
|
||||
validators.UserStoryStatusExportValidator,)
|
||||
if "us_duedates" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"us_duedates",
|
||||
validators.UserStoryDueDateExportValidator,)
|
||||
if "task_statuses" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"task_statuses",
|
||||
validators.TaskStatusExportValidator)
|
||||
if "task_duedates" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"task_duedates",
|
||||
validators.TaskDueDateExportValidator)
|
||||
if "priorities" in data:
|
||||
services.store.store_project_attributes_values(project_serialized.object, data,
|
||||
"priorities",
|
||||
|
|
|
@ -60,14 +60,6 @@ class UserStoryStatusExportSerializer(RelatedExportSerializer):
|
|||
wip_limit = Field()
|
||||
|
||||
|
||||
class UserStoryDueDateExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
order = Field()
|
||||
by_default = Field()
|
||||
color = Field()
|
||||
days_to_due = Field()
|
||||
|
||||
|
||||
class EpicStatusExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
slug = Field()
|
||||
|
@ -84,14 +76,6 @@ class TaskStatusExportSerializer(RelatedExportSerializer):
|
|||
color = Field()
|
||||
|
||||
|
||||
class TaskDueDateExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
order = Field()
|
||||
by_default = Field()
|
||||
color = Field()
|
||||
days_to_due = Field()
|
||||
|
||||
|
||||
class IssueStatusExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
slug = Field()
|
||||
|
@ -100,14 +84,6 @@ class IssueStatusExportSerializer(RelatedExportSerializer):
|
|||
color = Field()
|
||||
|
||||
|
||||
class IssueDueDateExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
order = Field()
|
||||
by_default = Field()
|
||||
color = Field()
|
||||
days_to_due = Field()
|
||||
|
||||
|
||||
class PriorityExportSerializer(RelatedExportSerializer):
|
||||
name = Field()
|
||||
order = Field()
|
||||
|
@ -460,12 +436,9 @@ class ProjectExportSerializer(WatcheableObjectLightSerializerMixin):
|
|||
points = PointsExportSerializer(many=True)
|
||||
epic_statuses = EpicStatusExportSerializer(many=True)
|
||||
us_statuses = UserStoryStatusExportSerializer(many=True)
|
||||
us_duedates = UserStoryDueDateExportSerializer(many=True)
|
||||
task_statuses = TaskStatusExportSerializer(many=True)
|
||||
task_duedates = TaskDueDateExportSerializer(many=True)
|
||||
issue_types = IssueTypeExportSerializer(many=True)
|
||||
issue_statuses = IssueStatusExportSerializer(many=True)
|
||||
issue_duedates = IssueDueDateExportSerializer(many=True)
|
||||
priorities = PriorityExportSerializer(many=True)
|
||||
severities = SeverityExportSerializer(many=True)
|
||||
tags_colors = Field()
|
||||
|
|
|
@ -233,8 +233,7 @@ def _store_project_attribute_value(project, data, field, serializer):
|
|||
def store_project_attributes_values(project, data, field, serializer):
|
||||
result = []
|
||||
for choice_data in data.get(field, []):
|
||||
result.append(_store_project_attribute_value(project, choice_data, field,
|
||||
serializer))
|
||||
result.append(_store_project_attribute_value(project, choice_data, field, serializer))
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
from .validators import PointsExportValidator
|
||||
from .validators import EpicStatusExportValidator
|
||||
from .validators import UserStoryStatusExportValidator
|
||||
from .validators import UserStoryDueDateExportValidator
|
||||
from .validators import TaskStatusExportValidator
|
||||
from .validators import TaskDueDateExportValidator
|
||||
from .validators import IssueStatusExportValidator
|
||||
from .validators import IssueDueDateExportValidator
|
||||
from .validators import PriorityExportValidator
|
||||
from .validators import SeverityExportValidator
|
||||
from .validators import IssueTypeExportValidator
|
||||
|
|
|
@ -62,36 +62,18 @@ class UserStoryStatusExportValidator(validators.ModelValidator):
|
|||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class UserStoryDueDateExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.UserStoryDueDate
|
||||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class TaskStatusExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.TaskStatus
|
||||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class TaskDueDateExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.TaskDueDate
|
||||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class IssueStatusExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.IssueStatus
|
||||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class IssueDueDateExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.IssueDueDate
|
||||
exclude = ('id', 'project')
|
||||
|
||||
|
||||
class PriorityExportValidator(validators.ModelValidator):
|
||||
class Meta:
|
||||
model = projects_models.Priority
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# 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 as dt
|
||||
from datetime import datetime
|
||||
|
||||
from django_jinja import library
|
||||
from django_sites import get_by_id as get_site_by_id
|
||||
|
@ -34,7 +34,7 @@ def resolve(type, *args):
|
|||
return url_tmpl.format(scheme=scheme, domain=site.domain, url=url)
|
||||
|
||||
|
||||
@library.filter(name="parse_and_format_date")
|
||||
def parse_and_format_date(value, *args):
|
||||
date_value = dt.datetime.strptime(value, '%Y-%m-%d')
|
||||
@library.filter(name="date")
|
||||
def format_date(value, *args):
|
||||
date_value = datetime.strptime(value, '%Y-%m-%d')
|
||||
return date_value.strftime('%d %b %Y')
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
from taiga.users.models import User
|
||||
from taiga.projects.models import Membership
|
||||
|
||||
from taiga.permissions.choices import ANON_PERMISSIONS
|
||||
|
||||
|
||||
def resolve_users_bindings(users_bindings):
|
||||
new_users_bindings = {}
|
||||
|
@ -52,15 +50,3 @@ def create_memberships(users_bindings, project, creator, role_name):
|
|||
is_admin=False,
|
||||
invited_by=creator,
|
||||
)
|
||||
|
||||
def set_base_permissions_for_project(project):
|
||||
if project.is_private:
|
||||
return
|
||||
|
||||
anon_permissions = list(
|
||||
map(lambda perm: perm[0], ANON_PERMISSIONS))
|
||||
project.anon_permissions = list(
|
||||
set((project.anon_permissions or []) + anon_permissions))
|
||||
project.public_permissions = list(
|
||||
set((project.public_permissions or []) + anon_permissions))
|
||||
project.save()
|
||||
|
|
|
@ -262,7 +262,6 @@ class TrelloImporter:
|
|||
project=project
|
||||
)
|
||||
import_service.create_memberships(options.get('users_bindings', {}), project, self._user, "trello")
|
||||
import_service.set_base_permissions_for_project(project)
|
||||
return project
|
||||
|
||||
def _import_user_stories_data(self, data, project, options):
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -37,7 +37,7 @@ class AutolinkExtension(markdown.Extension):
|
|||
* GitHub only accepts URLs with protocols or "www.", whereas Gruber's regex
|
||||
accepts things like "foo.com/bar".
|
||||
"""
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
url_re = r'(?i)\b((?:(?:ftp|https?)://|www\d{0,3}[.])([^\s<>]+))'
|
||||
autolink = AutolinkPattern(url_re, md)
|
||||
md.inlinePatterns.add('gfm-autolink', autolink, '_end')
|
||||
|
|
|
@ -19,7 +19,7 @@ class AutomailPattern(markdown.inlinepatterns.Pattern):
|
|||
class AutomailExtension(markdown.Extension):
|
||||
"""An extension that turns all email addresses into links."""
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
mail_re = r'\b(?i)([a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]+)\b'
|
||||
automail = AutomailPattern(mail_re, md)
|
||||
md.inlinePatterns.add('gfm-automail', automail, '_end')
|
||||
|
|
|
@ -152,7 +152,7 @@ EMOJIS_SET = {
|
|||
|
||||
class EmojifyExtension(Extension):
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
md.registerExtension(self)
|
||||
md.preprocessors.add('emojify',
|
||||
EmojifyPreprocessor(md),
|
||||
|
|
|
@ -30,7 +30,7 @@ from markdown.util import etree, AtomicString
|
|||
|
||||
|
||||
class MentionsExtension(Extension):
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
MENTION_RE = r"(@)([\w.-]+)"
|
||||
mentionsPattern = MentionsPattern(MENTION_RE)
|
||||
mentionsPattern.md = md
|
||||
|
|
|
@ -36,7 +36,7 @@ class TaigaReferencesExtension(Extension):
|
|||
self.project = project
|
||||
return super().__init__(*args, **kwargs)
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
TAIGA_REFERENCE_RE = r'(?<=^|(?<=[^a-zA-Z0-9-\[]))#(\d+)'
|
||||
referencesPattern = TaigaReferencesPattern(TAIGA_REFERENCE_RE, self.project)
|
||||
referencesPattern.md = md
|
||||
|
|
|
@ -28,6 +28,6 @@ class SemiSaneListExtension(markdown.Extension):
|
|||
newlines.
|
||||
"""
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
md.parser.blockprocessors['olist'] = SemiSaneOListProcessor(md.parser)
|
||||
md.parser.blockprocessors['ulist'] = SemiSaneUListProcessor(md.parser)
|
||||
|
|
|
@ -31,7 +31,7 @@ class SpacedLinkExtension(markdown.Extension):
|
|||
extension adds such support.
|
||||
"""
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
md.inlinePatterns["link"] = \
|
||||
markdown.inlinepatterns.LinkPattern(SPACED_LINK_RE, md)
|
||||
md.inlinePatterns["reference"] = \
|
||||
|
|
|
@ -14,6 +14,6 @@ class StrikethroughExtension(markdown.Extension):
|
|||
For example: ``~~strike~~``.
|
||||
"""
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
pattern = markdown.inlinepatterns.SimpleTagPattern(STRIKE_RE, 'del')
|
||||
md.inlinePatterns.add('gfm-strikethrough', pattern, '_end')
|
||||
|
|
|
@ -28,7 +28,7 @@ from taiga.front.templatetags.functions import resolve
|
|||
|
||||
class TargetBlankLinkExtension(markdown.Extension):
|
||||
"""An extension that add target="_blank" to all external links."""
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
md.treeprocessors.add("target_blank_links",
|
||||
TargetBlankLinksTreeprocessor(md),
|
||||
"<prettify")
|
||||
|
|
|
@ -34,7 +34,7 @@ class WikiLinkExtension(Extension):
|
|||
self.project = project
|
||||
return super().__init__(*args, **kwargs)
|
||||
|
||||
def extendMarkdown(self, md):
|
||||
def extendMarkdown(self, md, md_globals):
|
||||
WIKILINK_RE = r"\[\[([\w0-9_ -]+)(\|[^\]]+)?\]\]"
|
||||
md.inlinePatterns.add("wikilinks",
|
||||
WikiLinksPattern(md, WIKILINK_RE, self.project),
|
||||
|
|
|
@ -118,10 +118,9 @@ class ProjectAdmin(admin.ModelAdmin):
|
|||
}),
|
||||
(_("Default values"), {
|
||||
"classes": ("collapse",),
|
||||
"fields": (("default_us_status", "default_points"),
|
||||
"fields": (("default_points", "default_us_status"),
|
||||
"default_task_status",
|
||||
"default_issue_status",
|
||||
("default_priority", "default_severity", "default_issue_type")),
|
||||
("default_issue_status", "default_priority", "default_severity", "default_issue_type")),
|
||||
}),
|
||||
(_("Activity"), {
|
||||
"classes": ("collapse",),
|
||||
|
|
|
@ -45,7 +45,6 @@ from taiga.projects.epics.models import Epic
|
|||
from taiga.projects.history.mixins import HistoryResourceMixin
|
||||
from taiga.projects.issues.models import Issue
|
||||
from taiga.projects.likes.mixins.viewsets import LikedResourceMixin, FansViewSetMixin
|
||||
from taiga.projects.notifications.apps import signal_members_added
|
||||
from taiga.projects.notifications.mixins import WatchersViewSetMixin
|
||||
from taiga.projects.notifications.choices import NotifyLevel
|
||||
from taiga.projects.mixins.on_destroy import MoveOnDestroyMixin
|
||||
|
@ -113,8 +112,8 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
|
|||
qs = project_utils.attach_notify_policies(qs)
|
||||
qs = project_utils.attach_is_fan(qs, user=self.request.user)
|
||||
qs = project_utils.attach_my_role_permissions(qs, user=self.request.user)
|
||||
qs = project_utils.attach_my_role_permissions(qs, user=self.request.user)
|
||||
qs = project_utils.attach_closed_milestones(qs)
|
||||
qs = project_utils.attach_my_homepage(qs, user=self.request.user)
|
||||
else:
|
||||
qs = project_utils.attach_extra_info(qs, user=self.request.user)
|
||||
|
||||
|
@ -275,11 +274,6 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
|
|||
project.save()
|
||||
return uuid_value
|
||||
|
||||
def _delete_csv_uuid(self, project, field):
|
||||
setattr(project, field, None)
|
||||
project.save()
|
||||
return getattr(project, field)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def regenerate_epics_csv_uuid(self, request, pk=None):
|
||||
project = self.get_object()
|
||||
|
@ -312,38 +306,6 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
|
|||
data = {"uuid": self._regenerate_csv_uuid(project, "issues_csv_uuid")}
|
||||
return response.Ok(data)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def delete_epics_csv_uuid(self, request, pk=None):
|
||||
project = self.get_object()
|
||||
self.check_permissions(request, "delete_epics_csv_uuid", project)
|
||||
self.pre_conditions_on_save(project)
|
||||
data = {"uuid": self._delete_csv_uuid(project, "epics_csv_uuid")}
|
||||
return response.Ok(data)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def delete_userstories_csv_uuid(self, request, pk=None):
|
||||
project = self.get_object()
|
||||
self.check_permissions(request, "delete_userstories_csv_uuid", project)
|
||||
self.pre_conditions_on_save(project)
|
||||
data = {"uuid": self._delete_csv_uuid(project, "userstories_csv_uuid")}
|
||||
return response.Ok(data)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def delete_tasks_csv_uuid(self, request, pk=None):
|
||||
project = self.get_object()
|
||||
self.check_permissions(request, "delete_tasks_csv_uuid", project)
|
||||
self.pre_conditions_on_save(project)
|
||||
data = {"uuid": self._delete_csv_uuid(project, "tasks_csv_uuid")}
|
||||
return response.Ok(data)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def delete_issues_csv_uuid(self, request, pk=None):
|
||||
project = self.get_object()
|
||||
self.check_permissions(request, "delete_issues_csv_uuid", project)
|
||||
self.pre_conditions_on_save(project)
|
||||
data = {"uuid": self._delete_csv_uuid(project, "issues_csv_uuid")}
|
||||
return response.Ok(data)
|
||||
|
||||
@list_route(methods=["GET"])
|
||||
def by_slug(self, request, *args, **kwargs):
|
||||
slug = request.QUERY_PARAMS.get("slug", None)
|
||||
|
@ -623,60 +585,6 @@ class PointsViewSet(MoveOnDestroyMixin, BlockedByProjectMixin,
|
|||
return super().create(request, *args, **kwargs)
|
||||
|
||||
|
||||
class UserStoryDueDateViewSet(BlockedByProjectMixin, ModelCrudViewSet):
|
||||
|
||||
model = models.UserStoryDueDate
|
||||
serializer_class = serializers.UserStoryDueDateSerializer
|
||||
validator_class = validators.UserStoryDueDateValidator
|
||||
permission_classes = (permissions.UserStoryDueDatePermission,)
|
||||
filter_backends = (filters.CanViewProjectFilterBackend,)
|
||||
filter_fields = ('project',)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
project_id = request.DATA.get("project", 0)
|
||||
with advisory_lock("user-story-due-date-creation-{}".format(project_id)):
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
def pre_delete(self, obj):
|
||||
if obj.by_default:
|
||||
raise exc.BadRequest(
|
||||
_("You can't delete user story due date by default"))
|
||||
|
||||
@list_route(methods=["POST"])
|
||||
def create_default(self, request, **kwargs):
|
||||
context = {
|
||||
"request": request
|
||||
}
|
||||
validator = validators.DueDatesCreationValidator(data=request.DATA,
|
||||
context=context)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
project_id = request.DATA.get('project_id')
|
||||
project = models.Project.objects.get(id=project_id)
|
||||
|
||||
if project.us_duedates.all():
|
||||
raise exc.BadRequest(_("Project already have due dates"))
|
||||
|
||||
project_template = models.ProjectTemplate.objects.get(
|
||||
id=project.creation_template.id)
|
||||
|
||||
for us_duedate in project_template.us_duedates:
|
||||
models.UserStoryDueDate.objects.create(
|
||||
name=us_duedate["name"],
|
||||
by_default=us_duedate["by_default"],
|
||||
color=us_duedate["color"],
|
||||
days_to_due=us_duedate["days_to_due"],
|
||||
order=us_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
project.save()
|
||||
|
||||
serializer = self.get_serializer(project.us_duedates.all(), many=True)
|
||||
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
|
||||
class TaskStatusViewSet(MoveOnDestroyMixin, BlockedByProjectMixin,
|
||||
ModelCrudViewSet, BulkUpdateOrderMixin):
|
||||
|
||||
|
@ -699,61 +607,6 @@ class TaskStatusViewSet(MoveOnDestroyMixin, BlockedByProjectMixin,
|
|||
return super().create(request, *args, **kwargs)
|
||||
|
||||
|
||||
class TaskDueDateViewSet(BlockedByProjectMixin, ModelCrudViewSet):
|
||||
|
||||
model = models.TaskDueDate
|
||||
serializer_class = serializers.TaskDueDateSerializer
|
||||
validator_class = validators.TaskDueDateValidator
|
||||
permission_classes = (permissions.TaskDueDatePermission,)
|
||||
filter_backends = (filters.CanViewProjectFilterBackend,)
|
||||
filter_fields = ('project',)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
project_id = request.DATA.get("project", 0)
|
||||
with advisory_lock("task-due-date-creation-{}".format(project_id)):
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
def pre_delete(self, obj):
|
||||
if obj.by_default:
|
||||
raise exc.BadRequest(
|
||||
_("You can't delete task due date by default"))
|
||||
|
||||
@list_route(methods=["POST"])
|
||||
def create_default(self, request, **kwargs):
|
||||
context = {
|
||||
"request": request
|
||||
}
|
||||
validator = validators.DueDatesCreationValidator(data=request.DATA,
|
||||
context=context)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
project_id = request.DATA.get('project_id')
|
||||
project = models.Project.objects.get(id=project_id)
|
||||
|
||||
if project.task_duedates.all():
|
||||
raise exc.BadRequest(_("Project already have task due dates"))
|
||||
|
||||
project_template = models.ProjectTemplate.objects.get(
|
||||
id=project.creation_template.id)
|
||||
|
||||
for task_duedate in project_template.task_duedates:
|
||||
models.TaskDueDate.objects.create(
|
||||
name=task_duedate["name"],
|
||||
by_default=task_duedate["by_default"],
|
||||
color=task_duedate["color"],
|
||||
days_to_due=task_duedate["days_to_due"],
|
||||
order=task_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
project.save()
|
||||
|
||||
serializer = self.get_serializer(project.task_duedates.all(),
|
||||
many=True)
|
||||
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
|
||||
class SeverityViewSet(MoveOnDestroyMixin, BlockedByProjectMixin,
|
||||
ModelCrudViewSet, BulkUpdateOrderMixin):
|
||||
|
||||
|
@ -839,61 +692,6 @@ class IssueStatusViewSet(MoveOnDestroyMixin, BlockedByProjectMixin,
|
|||
return super().create(request, *args, **kwargs)
|
||||
|
||||
|
||||
class IssueDueDateViewSet(BlockedByProjectMixin, ModelCrudViewSet):
|
||||
|
||||
model = models.IssueDueDate
|
||||
serializer_class = serializers.IssueDueDateSerializer
|
||||
validator_class = validators.IssueDueDateValidator
|
||||
permission_classes = (permissions.IssueDueDatePermission,)
|
||||
filter_backends = (filters.CanViewProjectFilterBackend,)
|
||||
filter_fields = ('project',)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
project_id = request.DATA.get("project", 0)
|
||||
with advisory_lock("issue-due-date-creation-{}".format(project_id)):
|
||||
return super().create(request, *args, **kwargs)
|
||||
|
||||
def pre_delete(self, obj):
|
||||
if obj.by_default:
|
||||
raise exc.BadRequest(
|
||||
_("You can't delete issue due date by default"))
|
||||
|
||||
@list_route(methods=["POST"])
|
||||
def create_default(self, request, **kwargs):
|
||||
context = {
|
||||
"request": request
|
||||
}
|
||||
validator = validators.DueDatesCreationValidator(data=request.DATA,
|
||||
context=context)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
project_id = request.DATA.get('project_id')
|
||||
project = models.Project.objects.get(id=project_id)
|
||||
|
||||
if project.issue_duedates.all():
|
||||
raise exc.BadRequest(_("Project already have issue due dates"))
|
||||
|
||||
project_template = models.ProjectTemplate.objects.get(
|
||||
id=project.creation_template.id)
|
||||
|
||||
for issue_duedate in project_template.issue_duedates:
|
||||
models.IssueDueDate.objects.create(
|
||||
name=issue_duedate["name"],
|
||||
by_default=issue_duedate["by_default"],
|
||||
color=issue_duedate["color"],
|
||||
days_to_due=issue_duedate["days_to_due"],
|
||||
order=issue_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
project.save()
|
||||
|
||||
serializer = self.get_serializer(project.issue_duedates.all(),
|
||||
many=True)
|
||||
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
|
||||
######################################################
|
||||
## Project Template
|
||||
######################################################
|
||||
|
@ -981,10 +779,6 @@ class MembershipViewSet(BlockedByProjectMixin, ModelCrudViewSet):
|
|||
invitation_extra_text=invitation_extra_text,
|
||||
callback=self.post_save,
|
||||
precall=self.pre_save)
|
||||
signal_members_added.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
project=project,
|
||||
new_members=members)
|
||||
except exc.ValidationError as err:
|
||||
return response.BadRequest(err.message_dict)
|
||||
|
||||
|
|
|
@ -53,17 +53,17 @@ def connect_memberships_signals():
|
|||
sender=apps.get_model("projects", "Membership"),
|
||||
dispatch_uid='membership_pre_delete')
|
||||
|
||||
# On membership object is created, reorder and create notify policies
|
||||
signals.post_save.connect(handlers.membership_post_save,
|
||||
# On membership object is deleted, update notify policies of all objects relation.
|
||||
signals.post_save.connect(handlers.create_notify_policy,
|
||||
sender=apps.get_model("projects", "Membership"),
|
||||
dispatch_uid='membership_post_save')
|
||||
dispatch_uid='create-notify-policy')
|
||||
|
||||
|
||||
def disconnect_memberships_signals():
|
||||
signals.pre_delete.disconnect(sender=apps.get_model("projects", "Membership"),
|
||||
dispatch_uid='membership_pre_delete')
|
||||
signals.post_save.disconnect(sender=apps.get_model("projects", "Membership"),
|
||||
dispatch_uid='membership_post_save')
|
||||
dispatch_uid='create-notify-policy')
|
||||
|
||||
|
||||
## US Statuses Signals
|
||||
|
|
|
@ -15,13 +15,12 @@
|
|||
|
||||
from django.conf import settings
|
||||
|
||||
from taiga.base.utils.thumbnails import get_thumbnail_url, get_thumbnail
|
||||
from taiga.base.utils.thumbnails import get_thumbnail_url
|
||||
|
||||
|
||||
def get_timeline_image_thumbnail_name(attachment):
|
||||
def get_timeline_image_thumbnail_url(attachment):
|
||||
if attachment.attached_file:
|
||||
thumbnail = get_thumbnail(attachment.attached_file, settings.THN_ATTACHMENT_TIMELINE)
|
||||
return thumbnail.name if thumbnail else None
|
||||
return get_thumbnail_url(attachment.attached_file, settings.THN_ATTACHMENT_TIMELINE)
|
||||
return None
|
||||
|
||||
|
||||
|
@ -30,7 +29,6 @@ def get_card_image_thumbnail_url(attachment):
|
|||
return get_thumbnail_url(attachment.attached_file, settings.THN_ATTACHMENT_CARD)
|
||||
return None
|
||||
|
||||
|
||||
def get_attachment_image_preview_url(attachment):
|
||||
if attachment.attached_file:
|
||||
return get_thumbnail_url(attachment.attached_file, settings.THN_ATTACHMENT_PREVIEW)
|
||||
|
|
|
@ -22,13 +22,7 @@ from taiga.base.api.permissions import TaigaResourcePermission
|
|||
|
||||
class IsContactActivated(PermissionComponent):
|
||||
def check_permissions(self, request, view, obj=None):
|
||||
if not request.user.is_authenticated() or not obj.project.is_contact_activated:
|
||||
return False
|
||||
|
||||
if obj.project.is_private:
|
||||
return obj.project.cached_memberships_for_user(request.user)
|
||||
|
||||
return True
|
||||
return request.user.is_authenticated() and obj.project.is_contact_activated
|
||||
|
||||
|
||||
class ContactPermission(TaigaResourcePermission):
|
||||
|
|
|
@ -24,17 +24,11 @@ MULTILINE_TYPE = "multiline"
|
|||
RICHTEXT_TYPE = "richtext"
|
||||
DATE_TYPE = "date"
|
||||
URL_TYPE = "url"
|
||||
DROPDOWN_TYPE = "dropdown"
|
||||
CHECKBOX_TYPE = "checkbox"
|
||||
NUMBER_TYPE = "number"
|
||||
|
||||
TYPES_CHOICES = (
|
||||
(TEXT_TYPE, _("Text")),
|
||||
(MULTILINE_TYPE, _("Multi-Line Text")),
|
||||
(RICHTEXT_TYPE, _("Rich text")),
|
||||
(DATE_TYPE, _("Date")),
|
||||
(URL_TYPE, _("Url")),
|
||||
(DROPDOWN_TYPE, _("Dropdown")),
|
||||
(CHECKBOX_TYPE, _("Checkbox")),
|
||||
(NUMBER_TYPE, _("Number")),
|
||||
(URL_TYPE, _("Url"))
|
||||
)
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2018-10-22 16:24
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import django.core.serializers.json
|
||||
from django.db import migrations, models
|
||||
import taiga.base.db.models.fields.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('custom_attributes', '0012_auto_20161201_1628'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='epiccustomattribute',
|
||||
name='extra',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, default=None, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='issuecustomattribute',
|
||||
name='extra',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, default=None, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='taskcustomattribute',
|
||||
name='extra',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, default=None, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='userstorycustomattribute',
|
||||
name='extra',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, default=None, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='epiccustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='issuecustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='taskcustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='userstorycustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
]
|
|
@ -1,35 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2018-10-25 07:11
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('custom_attributes', '0013_auto_20181022_1624'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='epiccustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown'), ('checkbox', 'Checkbox'), ('number', 'Number')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='issuecustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown'), ('checkbox', 'Checkbox'), ('number', 'Number')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='taskcustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown'), ('checkbox', 'Checkbox'), ('number', 'Number')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='userstorycustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('richtext', 'Rich text'), ('date', 'Date'), ('url', 'Url'), ('dropdown', 'Dropdown'), ('checkbox', 'Checkbox'), ('number', 'Number')], default='text', max_length=16, verbose_name='type'),
|
||||
),
|
||||
]
|
|
@ -41,7 +41,7 @@ class AbstractCustomAttribute(models.Model):
|
|||
order = models.BigIntegerField(null=False, blank=False, default=timestamp_ms, verbose_name=_("order"))
|
||||
project = models.ForeignKey("projects.Project", null=False, blank=False, related_name="%(class)ss",
|
||||
verbose_name=_("project"))
|
||||
extra = JSONField(blank=True, default=None, null=True)
|
||||
|
||||
created_date = models.DateTimeField(null=False, blank=False, default=timezone.now,
|
||||
verbose_name=_("created date"))
|
||||
modified_date = models.DateTimeField(null=False, blank=False,
|
||||
|
|
|
@ -32,7 +32,6 @@ class BaseCustomAttributeSerializer(serializers.LightSerializer):
|
|||
type = Field()
|
||||
order = Field()
|
||||
project = Field(attr="project_id")
|
||||
extra = Field()
|
||||
created_date = Field()
|
||||
modified_date = Field()
|
||||
|
||||
|
|
|
@ -164,11 +164,10 @@ def update_epic_related_userstories_order_in_bulk(bulk_data: list, epic: object)
|
|||
|
||||
def epics_to_csv(project, queryset):
|
||||
csv_data = io.StringIO()
|
||||
fieldnames = ["id", "ref", "subject", "description", "owner", "owner_full_name",
|
||||
"assigned_to", "assigned_to_full_name", "status", "epics_order",
|
||||
"client_requirement", "team_requirement", "attachments", "tags",
|
||||
"watchers", "voters", "created_date", "modified_date",
|
||||
"related_user_stories"]
|
||||
fieldnames = ["ref", "subject", "description", "owner", "owner_full_name", "assigned_to",
|
||||
"assigned_to_full_name", "status", "epics_order", "client_requirement",
|
||||
"team_requirement", "attachments", "tags", "watchers", "voters",
|
||||
"created_date", "modified_date", "related_user_stories"]
|
||||
|
||||
custom_attrs = project.epiccustomattributes.all()
|
||||
for custom_attr in custom_attrs:
|
||||
|
@ -189,7 +188,6 @@ def epics_to_csv(project, queryset):
|
|||
writer.writeheader()
|
||||
for epic in queryset:
|
||||
epic_data = {
|
||||
"id": epic.id,
|
||||
"ref": epic.ref,
|
||||
"subject": epic.subject,
|
||||
"description": epic.description,
|
||||
|
|
|
@ -120,29 +120,6 @@
|
|||
"wip_limit": null
|
||||
}
|
||||
],
|
||||
"us_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"points": [
|
||||
{
|
||||
"name": "?",
|
||||
|
@ -242,29 +219,6 @@
|
|||
"is_closed": false
|
||||
}
|
||||
],
|
||||
"task_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"issue_statuses": [
|
||||
{
|
||||
"slug": "new",
|
||||
|
@ -333,29 +287,6 @@
|
|||
"order": 3
|
||||
}
|
||||
],
|
||||
"issue_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"priorities": [
|
||||
{
|
||||
"color": "#666666",
|
||||
|
@ -761,29 +692,6 @@
|
|||
"wip_limit": null
|
||||
}
|
||||
],
|
||||
"us_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"points": [
|
||||
{
|
||||
"name": "?",
|
||||
|
@ -883,29 +791,6 @@
|
|||
"is_closed": false
|
||||
}
|
||||
],
|
||||
"task_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"issue_statuses": [
|
||||
{
|
||||
"slug": "new",
|
||||
|
@ -974,29 +859,6 @@
|
|||
"order": 3
|
||||
}
|
||||
],
|
||||
"issue_duedates": [
|
||||
{
|
||||
"name": "Default",
|
||||
"order": 1,
|
||||
"by_default": true,
|
||||
"color": "#9dce0a",
|
||||
"days_to_due": null
|
||||
},
|
||||
{
|
||||
"name": "Due soon",
|
||||
"order": 2,
|
||||
"by_default": false,
|
||||
"color": "#ff9900",
|
||||
"days_to_due": 14
|
||||
},
|
||||
{
|
||||
"name": "Past due",
|
||||
"order": 3,
|
||||
"by_default": false,
|
||||
"color": "#ff8a84",
|
||||
"days_to_due": 0
|
||||
}
|
||||
],
|
||||
"priorities": [
|
||||
{
|
||||
"color": "#999999",
|
||||
|
|
|
@ -24,8 +24,6 @@ from taiga.base import response
|
|||
from taiga.base.decorators import detail_route
|
||||
from taiga.base.api import ReadOnlyListViewSet
|
||||
from taiga.mdrender.service import render as mdrender
|
||||
from taiga.projects.notifications import services as notifications_services
|
||||
from taiga.projects.notifications.apps import signal_mentions
|
||||
|
||||
from . import permissions
|
||||
from . import serializers
|
||||
|
@ -59,11 +57,6 @@ class HistoryViewSet(ReadOnlyListViewSet):
|
|||
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
def _get_new_mentions(self, obj: object, old_comment: str, new_comment: str):
|
||||
old_mentions = notifications_services.get_mentions(obj.project, old_comment)
|
||||
submitted_mentions = notifications_services.get_mentions(obj, new_comment)
|
||||
return list(set(submitted_mentions) - set(old_mentions))
|
||||
|
||||
@detail_route(methods=['get'])
|
||||
def comment_versions(self, request, pk):
|
||||
obj = self.get_object()
|
||||
|
@ -113,20 +106,11 @@ class HistoryViewSet(ReadOnlyListViewSet):
|
|||
}
|
||||
})
|
||||
|
||||
new_mentions = self._get_new_mentions(obj, history_entry.comment, comment)
|
||||
|
||||
history_entry.edit_comment_date = timezone.now()
|
||||
history_entry.comment = comment
|
||||
history_entry.comment_html = mdrender(obj.project, comment)
|
||||
history_entry.comment_versions = comment_versions
|
||||
history_entry.save()
|
||||
|
||||
if new_mentions:
|
||||
signal_mentions.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
mentions=new_mentions)
|
||||
|
||||
return response.Ok()
|
||||
|
||||
@detail_route(methods=['post'])
|
||||
|
@ -181,17 +165,6 @@ class HistoryViewSet(ReadOnlyListViewSet):
|
|||
self.check_permissions(request, "retrieve", obj)
|
||||
qs = services.get_history_queryset_by_model_instance(obj)
|
||||
qs = services.prefetch_owners_in_history_queryset(qs)
|
||||
|
||||
history_type = self.request.GET.get('type')
|
||||
if history_type == 'activity':
|
||||
qs = qs.filter(diff__isnull=False, comment__exact='').exclude(diff__exact='')
|
||||
|
||||
if self.request.GET.get(self.page_kwarg):
|
||||
qs = qs.order_by("-created_at")
|
||||
page = self.paginate_queryset(qs)
|
||||
serializer = self.get_pagination_serializer(page)
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
return self.response_for_queryset(qs)
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ from taiga.base.utils.iterators import as_tuple
|
|||
from taiga.base.utils.iterators import as_dict
|
||||
from taiga.mdrender.service import render as mdrender
|
||||
|
||||
from taiga.projects.attachments.services import get_timeline_image_thumbnail_name
|
||||
from taiga.projects.attachments.services import get_timeline_image_thumbnail_url
|
||||
|
||||
import os
|
||||
|
||||
|
@ -88,15 +88,15 @@ def _common_users_values(diff):
|
|||
values = {}
|
||||
users = set()
|
||||
|
||||
if "owner" in diff and isinstance(diff["owner"], int):
|
||||
if "owner" in diff:
|
||||
users.update(diff["owner"])
|
||||
if "assigned_to" in diff:
|
||||
users.update(diff["assigned_to"])
|
||||
if "assigned_users" in diff:
|
||||
[users.update(usrs_ids) for usrs_ids in diff["assigned_users"] if
|
||||
usrs_ids]
|
||||
|
||||
values["users"] = _get_users_values(users) if users else {}
|
||||
if users:
|
||||
values["users"] = _get_users_values(users)
|
||||
|
||||
return values
|
||||
|
||||
|
@ -198,14 +198,12 @@ def _generic_extract(obj:object, fields:list, default=None) -> dict:
|
|||
@as_tuple
|
||||
def extract_attachments(obj) -> list:
|
||||
for attach in obj.attachments.all():
|
||||
# Force the creation of a thumbnail for the timeline
|
||||
thumbnail_file = get_timeline_image_thumbnail_name(attach)
|
||||
thumb_url = get_timeline_image_thumbnail_url(attach)
|
||||
|
||||
yield {"id": attach.id,
|
||||
"filename": os.path.basename(attach.attached_file.name),
|
||||
"url": attach.attached_file.url,
|
||||
"attached_file": str(attach.attached_file),
|
||||
"thumbnail_file": thumbnail_file,
|
||||
"thumb_url": thumb_url,
|
||||
"is_deprecated": attach.is_deprecated,
|
||||
"description": attach.description,
|
||||
"order": attach.order}
|
||||
|
|
|
@ -30,7 +30,7 @@ from .choices import HistoryType
|
|||
from .choices import HISTORY_TYPE_CHOICES
|
||||
|
||||
from taiga.base.utils.diff import make_diff as make_diff_from_dicts
|
||||
from taiga.projects.custom_attributes.choices import CHECKBOX_TYPE, NUMBER_TYPE, TEXT_TYPE
|
||||
from taiga.projects.custom_attributes.choices import TEXT_TYPE
|
||||
|
||||
# This keys has been removed from freeze_impl so we can have objects where the
|
||||
# previous diff has value for the attribute and we want to prevent their propagation
|
||||
|
@ -180,13 +180,10 @@ class HistoryEntry(models.Model):
|
|||
diff_in, diff_out = self.diff[key]
|
||||
value_in = None
|
||||
value_out = None
|
||||
|
||||
if diff_in:
|
||||
users_list = [resolve_value("users", x) for x in diff_in if x]
|
||||
value_in = ", ".join(filter(None, users_list))
|
||||
value_in = ", ".join([resolve_value("users", x) for x in diff_in])
|
||||
if diff_out:
|
||||
users_list = [resolve_value("users", x) for x in diff_out if x]
|
||||
value_out = ", ".join(filter(None, users_list))
|
||||
value_out = ", ".join([resolve_value("users", x) for x in diff_out])
|
||||
value = [value_in, value_out]
|
||||
elif key == "points":
|
||||
points = {}
|
||||
|
@ -262,19 +259,13 @@ class HistoryEntry(models.Model):
|
|||
if aid in oldcustattrs and aid in newcustattrs:
|
||||
changes = make_diff_from_dicts(oldcustattrs[aid], newcustattrs[aid],
|
||||
excluded_keys=("name"))
|
||||
|
||||
newcustattr = newcustattrs.get(aid, {})
|
||||
if changes:
|
||||
change_type = newcustattr.get("type", TEXT_TYPE)
|
||||
|
||||
if change_type in [NUMBER_TYPE, CHECKBOX_TYPE]:
|
||||
old_value = oldcustattrs[aid].get("value")
|
||||
new_value = newcustattrs[aid].get("value")
|
||||
value_diff = [old_value, new_value]
|
||||
else:
|
||||
old_value = oldcustattrs[aid].get("value", "")
|
||||
new_value = newcustattrs[aid].get("value", "")
|
||||
value_diff = get_diff_of_htmls(old_value,
|
||||
new_value)
|
||||
value_diff = get_diff_of_htmls(old_value, new_value)
|
||||
change = {
|
||||
"name": newcustattr.get("name", ""),
|
||||
"changes": changes,
|
||||
|
@ -285,13 +276,6 @@ class HistoryEntry(models.Model):
|
|||
elif aid in oldcustattrs and aid not in newcustattrs:
|
||||
custom_attributes["deleted"].append(oldcustattrs[aid])
|
||||
elif aid not in oldcustattrs and aid in newcustattrs:
|
||||
newcustattr = newcustattrs.get(aid, {})
|
||||
change_type = newcustattr.get("type", TEXT_TYPE)
|
||||
if change_type in [NUMBER_TYPE, CHECKBOX_TYPE]:
|
||||
old_value = None
|
||||
new_value = newcustattrs[aid].get("value")
|
||||
value_diff = [old_value, new_value]
|
||||
else:
|
||||
new_value = newcustattrs[aid].get("value", "")
|
||||
value_diff = get_diff_of_htmls("", new_value)
|
||||
newcustattrs[aid]["value_diff"] = value_diff
|
||||
|
|
|
@ -234,8 +234,7 @@ def migrate_userstory_diff(obj: FrozenObj) -> FrozenObj:
|
|||
# with the 'assigned to' value
|
||||
if 'assigned_users' not in obj.snapshot.keys():
|
||||
snapshot = deepcopy(obj.snapshot)
|
||||
snapshot['assigned_users'] = [obj.snapshot['assigned_to']] \
|
||||
if obj.snapshot['assigned_to'] else []
|
||||
snapshot['assigned_users'] = [obj.snapshot['assigned_to']]
|
||||
|
||||
obj = FrozenObj(obj.key, snapshot)
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@
|
|||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{# DUE DATE #}
|
||||
{# ASSIGNED TO #}
|
||||
{% elif field_name == "due_date" %}
|
||||
<tr>
|
||||
<td valign="middle" rowspan="2" class="update-row-name">
|
||||
|
@ -158,7 +158,7 @@
|
|||
<td valign="top" class="update-row-from">
|
||||
{% if values.0 != None and values.0 != "" %}
|
||||
<span>{{ _("from") }}</span><br>
|
||||
<strong>{{ values.0|parse_and_format_date }}</strong>
|
||||
<strong>{{ values.0|date }}</strong>
|
||||
{% else %}
|
||||
<span>{{ _("from") }}</span><br>
|
||||
<strong>{{ _("Not set") }}</strong>
|
||||
|
@ -169,7 +169,7 @@
|
|||
<td valign="top">
|
||||
{% if values.1 != None and values.1 != "" %}
|
||||
<span>{{ _("to") }}</span><br>
|
||||
<strong>{{ values.1|parse_and_format_date }}</strong>
|
||||
<strong>{{ values.1|date }}</strong>
|
||||
{% else %}
|
||||
<span>{{ _("to") }}</span><br>
|
||||
<strong>{{ _("Not set") }}</strong>
|
||||
|
|
|
@ -28,12 +28,9 @@ from taiga.base.api.mixins import BlockedByProjectMixin
|
|||
from taiga.base.api.utils import get_object_or_404
|
||||
|
||||
from taiga.projects.history.mixins import HistoryResourceMixin
|
||||
from taiga.projects.milestones.models import Milestone
|
||||
from taiga.projects.mixins.by_ref import ByRefMixin
|
||||
from taiga.projects.models import Project, IssueStatus, Severity, Priority, IssueType
|
||||
from taiga.projects.notifications.mixins import AssignedToSignalMixin
|
||||
from taiga.projects.notifications.mixins import WatchedResourceMixin
|
||||
from taiga.projects.notifications.mixins import WatchersViewSetMixin
|
||||
from taiga.projects.notifications.mixins import WatchedResourceMixin, WatchersViewSetMixin
|
||||
from taiga.projects.occ import OCCResourceMixin
|
||||
from taiga.projects.tagging.api import TaggedResourceMixin
|
||||
from taiga.projects.votes.mixins.viewsets import VotedResourceMixin, VotersViewSetMixin
|
||||
|
@ -47,10 +44,8 @@ from . import serializers
|
|||
from . import validators
|
||||
|
||||
|
||||
class IssueViewSet(AssignedToSignalMixin, OCCResourceMixin, VotedResourceMixin,
|
||||
HistoryResourceMixin, WatchedResourceMixin, ByRefMixin,
|
||||
TaggedResourceMixin, BlockedByProjectMixin,
|
||||
ModelCrudViewSet):
|
||||
class IssueViewSet(OCCResourceMixin, VotedResourceMixin, HistoryResourceMixin, WatchedResourceMixin,
|
||||
ByRefMixin, TaggedResourceMixin, BlockedByProjectMixin, ModelCrudViewSet):
|
||||
validator_class = validators.IssueValidator
|
||||
queryset = models.Issue.objects.all()
|
||||
permission_classes = (permissions.IssuePermission, )
|
||||
|
@ -69,8 +64,7 @@ class IssueViewSet(AssignedToSignalMixin, OCCResourceMixin, VotedResourceMixin,
|
|||
filters.ModifiedDateFilter,
|
||||
filters.FinishedDateFilter,
|
||||
filters.OrderByFilterMixin)
|
||||
filter_fields = ("milestone",
|
||||
"project",
|
||||
filter_fields = ("project",
|
||||
"project__slug",
|
||||
"status__is_closed")
|
||||
order_by_fields = ("type",
|
||||
|
@ -151,11 +145,7 @@ class IssueViewSet(AssignedToSignalMixin, OCCResourceMixin, VotedResourceMixin,
|
|||
def get_queryset(self):
|
||||
qs = super().get_queryset()
|
||||
qs = qs.select_related("owner", "assigned_to", "status", "project")
|
||||
|
||||
include_attachments = "include_attachments" in self.request.QUERY_PARAMS
|
||||
qs = attach_extra_info(qs, user=self.request.user,
|
||||
include_attachments=include_attachments)
|
||||
|
||||
qs = attach_extra_info(qs, user=self.request.user)
|
||||
return qs
|
||||
|
||||
def pre_save(self, obj):
|
||||
|
@ -238,12 +228,9 @@ class IssueViewSet(AssignedToSignalMixin, OCCResourceMixin, VotedResourceMixin,
|
|||
raise exc.Blocked(_("Blocked element"))
|
||||
|
||||
issues = services.create_issues_in_bulk(
|
||||
data["bulk_issues"], milestone_id=data["milestone_id"],
|
||||
project=project, owner=request.user,
|
||||
status=project.default_issue_status,
|
||||
severity=project.default_severity,
|
||||
priority=project.default_priority,
|
||||
type=project.default_issue_type,
|
||||
data["bulk_issues"], project=project, owner=request.user,
|
||||
status=project.default_issue_status, severity=project.default_severity,
|
||||
priority=project.default_priority, type=project.default_issue_type,
|
||||
callback=self.post_save, precall=self.pre_save)
|
||||
|
||||
issues = self.get_queryset().filter(id__in=[i.id for i in issues])
|
||||
|
@ -253,22 +240,6 @@ class IssueViewSet(AssignedToSignalMixin, OCCResourceMixin, VotedResourceMixin,
|
|||
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
@list_route(methods=["POST"])
|
||||
def bulk_update_milestone(self, request, **kwargs):
|
||||
validator = validators.UpdateMilestoneBulkValidator(data=request.DATA)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
data = validator.data
|
||||
project = get_object_or_404(Project, pk=data["project_id"])
|
||||
milestone = get_object_or_404(Milestone, pk=data["milestone_id"])
|
||||
|
||||
self.check_permissions(request, "bulk_update_milestone", project)
|
||||
|
||||
ret = services.update_issues_milestone_in_bulk(data["bulk_issues"], milestone)
|
||||
|
||||
return response.Ok(ret)
|
||||
|
||||
|
||||
class IssueVotersViewSet(VotersViewSetMixin, ModelListViewSet):
|
||||
permission_classes = (permissions.IssueVotersPermission,)
|
||||
|
|
|
@ -25,11 +25,6 @@ def connect_issues_signals():
|
|||
from taiga.projects.tagging import signals as tagging_handlers
|
||||
from . import signals as handlers
|
||||
|
||||
# Cached prev object version
|
||||
signals.pre_save.connect(handlers.cached_prev_issue,
|
||||
sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="cached_prev_issue")
|
||||
|
||||
# Finished date
|
||||
signals.pre_save.connect(handlers.set_finished_date_when_edit_issue,
|
||||
sender=apps.get_model("issues", "Issue"),
|
||||
|
@ -40,14 +35,6 @@ def connect_issues_signals():
|
|||
sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="tags_normalization_issue")
|
||||
|
||||
# Open/Close US and Milestone
|
||||
signals.post_save.connect(handlers.try_to_close_or_open_milestone_when_create_or_edit_issue,
|
||||
sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="try_to_close_or_open_milestone_when_create_or_edit_issue")
|
||||
signals.post_delete.connect(handlers.try_to_close_milestone_when_delete_issue,
|
||||
sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="try_to_close_milestone_when_delete_issue")
|
||||
|
||||
|
||||
def connect_issues_custom_attributes_signals():
|
||||
from taiga.projects.custom_attributes import signals as custom_attributes_handlers
|
||||
|
@ -63,19 +50,11 @@ def connect_all_issues_signals():
|
|||
|
||||
|
||||
def disconnect_issues_signals():
|
||||
signals.pre_save.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="cached_prev_issue")
|
||||
|
||||
signals.pre_save.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="set_finished_date_when_edit_issue")
|
||||
signals.pre_save.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="tags_normalization_issue")
|
||||
|
||||
signals.post_save.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="try_to_close_or_open_milestone_when_create_or_edit_issue")
|
||||
signals.post_delete.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
dispatch_uid="try_to_close_milestone_when_delete_issue")
|
||||
|
||||
|
||||
def disconnect_issues_custom_attributes_signals():
|
||||
signals.post_save.disconnect(sender=apps.get_model("issues", "Issue"),
|
||||
|
|
|
@ -35,7 +35,6 @@ class IssuePermission(TaigaResourcePermission):
|
|||
filters_data_perms = AllowAny()
|
||||
csv_perms = AllowAny()
|
||||
bulk_create_perms = HasProjectPerm('add_issue')
|
||||
bulk_update_milestone_perms = HasProjectPerm('modify_issue')
|
||||
delete_comment_perms= HasProjectPerm('modify_issue')
|
||||
upvote_perms = IsAuthenticated() & HasProjectPerm('view_issues')
|
||||
downvote_perms = IsAuthenticated() & HasProjectPerm('view_issues')
|
||||
|
|
|
@ -21,7 +21,6 @@ from taiga.base.fields import Field, MethodField
|
|||
from taiga.base.neighbors import NeighborsSerializerMixin
|
||||
|
||||
from taiga.mdrender.service import render as mdrender
|
||||
from taiga.projects.attachments.serializers import BasicAttachmentsInfoSerializerMixin
|
||||
from taiga.projects.due_dates.serializers import DueDateSerializerMixin
|
||||
from taiga.projects.mixins.serializers import OwnerExtraInfoSerializerMixin
|
||||
from taiga.projects.mixins.serializers import ProjectExtraInfoSerializerMixin
|
||||
|
@ -35,8 +34,8 @@ from taiga.projects.votes.mixins.serializers import VoteResourceSerializerMixin
|
|||
class IssueListSerializer(VoteResourceSerializerMixin, WatchedResourceSerializer,
|
||||
OwnerExtraInfoSerializerMixin, AssignedToExtraInfoSerializerMixin,
|
||||
StatusExtraInfoSerializerMixin, ProjectExtraInfoSerializerMixin,
|
||||
BasicAttachmentsInfoSerializerMixin, DueDateSerializerMixin,
|
||||
TaggedInProjectResourceSerializer, serializers.LightSerializer):
|
||||
DueDateSerializerMixin, TaggedInProjectResourceSerializer,
|
||||
serializers.LightSerializer):
|
||||
id = Field()
|
||||
ref = Field()
|
||||
severity = Field(attr="severity_id")
|
||||
|
|
|
@ -26,9 +26,6 @@ from django.db import connection
|
|||
from django.utils.translation import ugettext as _
|
||||
|
||||
from taiga.base.utils import db, text
|
||||
from taiga.events import events
|
||||
|
||||
from taiga.projects.history.services import take_snapshot
|
||||
from taiga.projects.issues.apps import (
|
||||
connect_issues_signals,
|
||||
disconnect_issues_signals)
|
||||
|
@ -75,47 +72,18 @@ def create_issues_in_bulk(bulk_data, callback=None, precall=None, **additional_f
|
|||
return issues
|
||||
|
||||
|
||||
def snapshot_issues_in_bulk(bulk_data, user):
|
||||
for issue_data in bulk_data:
|
||||
try:
|
||||
issue = models.Issue.objects.get(pk=issue_data['issue_id'])
|
||||
take_snapshot(issue, user=user)
|
||||
except models.Issue.DoesNotExist:
|
||||
pass
|
||||
|
||||
|
||||
def update_issues_milestone_in_bulk(bulk_data: list, milestone: object):
|
||||
"""
|
||||
Update the milestone some issues adding
|
||||
`bulk_data` should be a list of dicts with the following format:
|
||||
[{'task_id': <value>}, ...]
|
||||
"""
|
||||
issue_milestones = {e["issue_id"]: milestone.id for e in bulk_data}
|
||||
issue_ids = issue_milestones.keys()
|
||||
|
||||
events.emit_event_for_ids(ids=issue_ids,
|
||||
content_type="issues.issues",
|
||||
projectid=milestone.project.pk)
|
||||
|
||||
db.update_attr_in_bulk_for_ids(issue_milestones, "milestone_id",
|
||||
model=models.Issue)
|
||||
|
||||
return issue_milestones
|
||||
|
||||
#####################################################
|
||||
# CSV
|
||||
#####################################################
|
||||
|
||||
|
||||
def issues_to_csv(project, queryset):
|
||||
csv_data = io.StringIO()
|
||||
fieldnames = ["id", "ref", "subject", "description", "sprint_id", "sprint",
|
||||
"sprint_estimated_start", "sprint_estimated_finish", "owner",
|
||||
"owner_full_name", "assigned_to", "assigned_to_full_name",
|
||||
"status", "severity", "priority", "type", "is_closed",
|
||||
"attachments", "external_reference", "tags", "watchers",
|
||||
"voters", "created_date", "modified_date", "finished_date",
|
||||
"due_date", "due_date_reason"]
|
||||
fieldnames = ["ref", "subject", "description", "sprint", "sprint_estimated_start",
|
||||
"sprint_estimated_finish", "owner", "owner_full_name", "assigned_to",
|
||||
"assigned_to_full_name", "status", "severity", "priority", "type",
|
||||
"is_closed", "attachments", "external_reference", "tags", "watchers",
|
||||
"voters", "created_date", "modified_date", "finished_date", "due_date",
|
||||
"due_date_reason"]
|
||||
|
||||
custom_attrs = project.issuecustomattributes.all()
|
||||
for custom_attr in custom_attrs:
|
||||
|
@ -135,11 +103,9 @@ def issues_to_csv(project, queryset):
|
|||
writer.writeheader()
|
||||
for issue in queryset:
|
||||
issue_data = {
|
||||
"id": issue.id,
|
||||
"ref": issue.ref,
|
||||
"subject": issue.subject,
|
||||
"description": issue.description,
|
||||
"sprint_id": issue.milestone.id if issue.milestone else None,
|
||||
"sprint": issue.milestone.name if issue.milestone else None,
|
||||
"sprint_estimated_start": issue.milestone.estimated_start if issue.milestone else None,
|
||||
"sprint_estimated_finish": issue.milestone.estimated_finish if issue.milestone else None,
|
||||
|
|
|
@ -16,22 +16,9 @@
|
|||
# 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 contextlib import suppress
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
####################################
|
||||
# Signals for cached prev task
|
||||
####################################
|
||||
|
||||
# Define the previous version of the task for use it on the post_save handler
|
||||
def cached_prev_issue(sender, instance, **kwargs):
|
||||
instance.prev = None
|
||||
if instance.id:
|
||||
instance.prev = sender.objects.get(id=instance.id)
|
||||
|
||||
|
||||
####################################
|
||||
# Signals for set finished date
|
||||
####################################
|
||||
|
@ -43,48 +30,3 @@ def set_finished_date_when_edit_issue(sender, instance, **kwargs):
|
|||
instance.finished_date = timezone.now()
|
||||
elif not instance.status.is_closed and instance.finished_date:
|
||||
instance.finished_date = None
|
||||
|
||||
|
||||
def try_to_close_or_open_milestone_when_create_or_edit_issue(sender, instance, created, **kwargs):
|
||||
if instance._importing:
|
||||
return
|
||||
|
||||
_try_to_close_or_open_milestone_when_create_or_edit_issue(instance)
|
||||
|
||||
|
||||
def try_to_close_milestone_when_delete_issue(sender, instance, **kwargs):
|
||||
if instance._importing:
|
||||
return
|
||||
|
||||
_try_to_close_milestone_when_delete_issue(instance)
|
||||
|
||||
|
||||
# Milestone
|
||||
def _try_to_close_or_open_milestone_when_create_or_edit_issue(instance):
|
||||
if instance._importing:
|
||||
return
|
||||
|
||||
from taiga.projects.milestones import services as milestone_service
|
||||
|
||||
if instance.milestone_id:
|
||||
if milestone_service.calculate_milestone_is_closed(instance.milestone):
|
||||
milestone_service.close_milestone(instance.milestone)
|
||||
else:
|
||||
milestone_service.open_milestone(instance.milestone)
|
||||
|
||||
if instance.prev and instance.prev.milestone_id and instance.prev.milestone_id != instance.milestone_id:
|
||||
if milestone_service.calculate_milestone_is_closed(instance.prev.milestone):
|
||||
milestone_service.close_milestone(instance.prev.milestone)
|
||||
else:
|
||||
milestone_service.open_milestone(instance.prev.milestone)
|
||||
|
||||
|
||||
def _try_to_close_milestone_when_delete_issue(instance):
|
||||
if instance._importing:
|
||||
return
|
||||
|
||||
from taiga.projects.milestones import services as milestone_service
|
||||
|
||||
with suppress(ObjectDoesNotExist):
|
||||
if instance.milestone_id and milestone_service.calculate_milestone_is_closed(instance.milestone):
|
||||
milestone_service.close_milestone(instance.milestone)
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# 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.projects.attachments.utils import attach_basic_attachments
|
||||
from taiga.projects.notifications.utils import attach_watchers_to_queryset
|
||||
from taiga.projects.notifications.utils import attach_total_watchers_to_queryset
|
||||
from taiga.projects.notifications.utils import attach_is_watcher_to_queryset
|
||||
|
@ -48,11 +47,7 @@ def attach_generated_user_stories(queryset, as_field="generated_user_stories_att
|
|||
return queryset
|
||||
|
||||
|
||||
def attach_extra_info(queryset, user=None, include_attachments=False):
|
||||
if include_attachments:
|
||||
queryset = attach_basic_attachments(queryset)
|
||||
queryset = queryset.extra(select={"include_attachments": "True"})
|
||||
|
||||
def attach_extra_info(queryset, user=None):
|
||||
queryset = attach_generated_user_stories(queryset)
|
||||
queryset = attach_total_voters_to_queryset(queryset)
|
||||
queryset = attach_watchers_to_queryset(queryset)
|
||||
|
|
|
@ -15,13 +15,10 @@
|
|||
#
|
||||
# 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.utils.translation import ugettext as _
|
||||
|
||||
from taiga.base.api import serializers
|
||||
from taiga.base.api import validators
|
||||
from taiga.base.exceptions import ValidationError
|
||||
from taiga.base.fields import PgArrayField
|
||||
from taiga.projects.milestones.models import Milestone
|
||||
from taiga.projects.mixins.validators import AssignedToValidator
|
||||
from taiga.projects.notifications.mixins import EditableWatchedResourceSerializer
|
||||
from taiga.projects.notifications.validators import WatchersValidator
|
||||
|
@ -44,37 +41,4 @@ class IssueValidator(AssignedToValidator, WatchersValidator, EditableWatchedReso
|
|||
|
||||
class IssuesBulkValidator(ProjectExistsValidator, validators.Validator):
|
||||
project_id = serializers.IntegerField()
|
||||
milestone_id = serializers.IntegerField(required=False)
|
||||
bulk_issues = serializers.CharField()
|
||||
|
||||
|
||||
# Milestone bulk validators
|
||||
|
||||
class _IssueMilestoneBulkValidator(validators.Validator):
|
||||
issue_id = serializers.IntegerField()
|
||||
|
||||
|
||||
class UpdateMilestoneBulkValidator(ProjectExistsValidator, validators.Validator):
|
||||
project_id = serializers.IntegerField()
|
||||
milestone_id = serializers.IntegerField()
|
||||
bulk_issues = _IssueMilestoneBulkValidator(many=True)
|
||||
|
||||
def validate_milestone_id(self, attrs, source):
|
||||
filters = {
|
||||
"project__id": attrs["project_id"],
|
||||
"id": attrs[source]
|
||||
}
|
||||
if not Milestone.objects.filter(**filters).exists():
|
||||
raise ValidationError(_("The milestone isn't valid for the project"))
|
||||
return attrs
|
||||
|
||||
def validate_bulk_tasks(self, attrs, source):
|
||||
filters = {
|
||||
"project__id": attrs["project_id"],
|
||||
"id__in": [issue["issue_id"] for issue in attrs[source]]
|
||||
}
|
||||
|
||||
if models.Issue.objects.filter(**filters).count() != len(filters["id__in"]):
|
||||
raise ValidationError(_("All the issues must be from the same project"))
|
||||
|
||||
return attrs
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2018-06-14 13:38
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import django.core.serializers.json
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import taiga.base.db.models.fields.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0059_auto_20170116_1633'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='IssueDueDate',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='name')),
|
||||
('order', models.IntegerField(default=10, verbose_name='order')),
|
||||
('by_default', models.BooleanField(default=False, verbose_name='by default')),
|
||||
('color', models.CharField(default='#999999', max_length=20, verbose_name='color')),
|
||||
('days_to_due', models.IntegerField(blank=True, default=None, null=True, verbose_name='days to due')),
|
||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_duedates', to='projects.Project', verbose_name='project')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'issue due date',
|
||||
'verbose_name_plural': 'issue due dates',
|
||||
'ordering': ['project', 'order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TaskDueDate',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='name')),
|
||||
('order', models.IntegerField(default=10, verbose_name='order')),
|
||||
('by_default', models.BooleanField(default=False, verbose_name='by default')),
|
||||
('color', models.CharField(default='#999999', max_length=20, verbose_name='color')),
|
||||
('days_to_due', models.IntegerField(blank=True, default=None, null=True, verbose_name='days to due')),
|
||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_duedates', to='projects.Project', verbose_name='project')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'task due date',
|
||||
'verbose_name_plural': 'task due dates',
|
||||
'ordering': ['project', 'order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='UserStoryDueDate',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='name')),
|
||||
('order', models.IntegerField(default=10, verbose_name='order')),
|
||||
('by_default', models.BooleanField(default=False, verbose_name='by default')),
|
||||
('color', models.CharField(default='#999999', max_length=20, verbose_name='color')),
|
||||
('days_to_due', models.IntegerField(blank=True, default=None, null=True, verbose_name='days to due')),
|
||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='us_duedates', to='projects.Project', verbose_name='project')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'user story due date',
|
||||
'verbose_name_plural': 'user story due dates',
|
||||
'ordering': ['project', 'order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='projecttemplate',
|
||||
name='issue_duedates',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True, verbose_name='issue duedates'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='projecttemplate',
|
||||
name='task_duedates',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True, verbose_name='task duedates'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='projecttemplate',
|
||||
name='us_duedates',
|
||||
field=taiga.base.db.models.fields.json.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True, verbose_name='us duedates'),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='issuestatus',
|
||||
unique_together=set([('project', 'name')]),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='userstoryduedate',
|
||||
unique_together=set([('project', 'name')]),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='taskduedate',
|
||||
unique_together=set([('project', 'name')]),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='issueduedate',
|
||||
unique_together=set([('project', 'name')]),
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2018-09-18 13:55
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0060_auto_20180614_1338'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='issuestatus',
|
||||
unique_together=set([('project', 'name'), ('project', 'slug')]),
|
||||
),
|
||||
]
|
|
@ -27,17 +27,11 @@ from taiga.base.api.mixins import BlockedByProjectMixin
|
|||
from taiga.base.api.utils import get_object_or_404
|
||||
from taiga.base.utils.db import get_object_or_none
|
||||
|
||||
from taiga.projects.models import Project
|
||||
from taiga.projects.notifications.mixins import WatchedResourceMixin
|
||||
from taiga.projects.notifications.mixins import WatchersViewSetMixin
|
||||
from taiga.projects.history.mixins import HistoryResourceMixin
|
||||
from taiga.projects.tasks.validators import UpdateMilestoneBulkValidator as \
|
||||
TasksUpdateMilestoneValidator
|
||||
from taiga.projects.issues.validators import UpdateMilestoneBulkValidator as \
|
||||
IssuesUpdateMilestoneValidator
|
||||
|
||||
from . import serializers
|
||||
from . import services
|
||||
from . import validators
|
||||
from . import models
|
||||
from . import permissions
|
||||
|
@ -148,69 +142,6 @@ class MilestoneViewSet(HistoryResourceMixin, WatchedResourceMixin,
|
|||
|
||||
return response.Ok(milestone_stats)
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def move_userstories_to_sprint(self, request, pk=None, **kwargs):
|
||||
milestone = get_object_or_404(models.Milestone, pk=pk)
|
||||
|
||||
self.check_permissions(request, "move_related_items", milestone)
|
||||
|
||||
validator = validators.UpdateMilestoneBulkValidator(data=request.DATA)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
data = validator.data
|
||||
project = get_object_or_404(Project, pk=data["project_id"])
|
||||
milestone_result = get_object_or_404(models.Milestone, pk=data["milestone_id"])
|
||||
|
||||
if data["bulk_stories"]:
|
||||
self.check_permissions(request, "move_uss_to_sprint", project)
|
||||
services.update_userstories_milestone_in_bulk(data["bulk_stories"], milestone_result)
|
||||
services.snapshot_userstories_in_bulk(data["bulk_stories"], request.user)
|
||||
|
||||
return response.NoContent()
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def move_tasks_to_sprint(self, request, pk=None, **kwargs):
|
||||
milestone = get_object_or_404(models.Milestone, pk=pk)
|
||||
|
||||
self.check_permissions(request, "move_related_items", milestone)
|
||||
|
||||
validator = TasksUpdateMilestoneValidator(data=request.DATA)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
data = validator.data
|
||||
project = get_object_or_404(Project, pk=data["project_id"])
|
||||
milestone_result = get_object_or_404(models.Milestone, pk=data["milestone_id"])
|
||||
|
||||
if data["bulk_tasks"]:
|
||||
self.check_permissions(request, "move_tasks_to_sprint", project)
|
||||
services.update_tasks_milestone_in_bulk(data["bulk_tasks"], milestone_result)
|
||||
services.snapshot_tasks_in_bulk(data["bulk_tasks"], request.user)
|
||||
|
||||
return response.NoContent()
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def move_issues_to_sprint(self, request, pk=None, **kwargs):
|
||||
milestone = get_object_or_404(models.Milestone, pk=pk)
|
||||
|
||||
self.check_permissions(request, "move_related_items", milestone)
|
||||
|
||||
validator = IssuesUpdateMilestoneValidator(data=request.DATA)
|
||||
if not validator.is_valid():
|
||||
return response.BadRequest(validator.errors)
|
||||
|
||||
data = validator.data
|
||||
project = get_object_or_404(Project, pk=data["project_id"])
|
||||
milestone_result = get_object_or_404(models.Milestone, pk=data["milestone_id"])
|
||||
|
||||
if data["bulk_issues"]:
|
||||
self.check_permissions(request, "move_issues_to_sprint", project)
|
||||
services.update_issues_milestone_in_bulk(data["bulk_issues"], milestone_result)
|
||||
services.snapshot_issues_in_bulk(data["bulk_issues"], request.user)
|
||||
|
||||
return response.NoContent()
|
||||
|
||||
|
||||
class MilestoneWatchersViewSet(WatchersViewSetMixin, ModelListViewSet):
|
||||
permission_classes = (permissions.MilestoneWatchersPermission,)
|
||||
|
|
|
@ -33,11 +33,6 @@ class MilestonePermission(TaigaResourcePermission):
|
|||
stats_perms = HasProjectPerm('view_milestones')
|
||||
watch_perms = IsAuthenticated() & HasProjectPerm('view_milestones')
|
||||
unwatch_perms = IsAuthenticated() & HasProjectPerm('view_milestones')
|
||||
move_related_items_perms = HasProjectPerm('modify_milestone')
|
||||
move_uss_to_sprint_perms = HasProjectPerm('modify_us')
|
||||
move_tasks_to_sprint_perms = HasProjectPerm('modify_task')
|
||||
move_issues_to_sprint_perms = HasProjectPerm('modify_issue')
|
||||
|
||||
|
||||
class MilestoneWatchersPermission(TaigaResourcePermission):
|
||||
enought_perms = IsProjectAdmin() | IsSuperUser()
|
||||
|
|
|
@ -16,29 +16,16 @@
|
|||
# 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.utils import db
|
||||
from taiga.events import events
|
||||
from taiga.projects.history.services import take_snapshot
|
||||
from taiga.projects.services import apply_order_updates
|
||||
from taiga.projects.issues.models import Issue
|
||||
from taiga.projects.tasks.models import Task
|
||||
from taiga.projects.userstories.models import UserStory
|
||||
from django.utils import timezone
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
|
||||
def calculate_milestone_is_closed(milestone):
|
||||
all_us_closed = all([user_story.is_closed for user_story in milestone.user_stories.all()])
|
||||
all_tasks_closed = all([task.status is not None and task.status.is_closed for task in
|
||||
milestone.tasks.all()])
|
||||
all_issues_closed = all([issue.is_closed for issue in milestone.issues.all()])
|
||||
|
||||
uss_check = milestone.user_stories.all().count() > 0 \
|
||||
and all_tasks_closed and all_us_closed and all_issues_closed
|
||||
issues_check = milestone.issues.all().count() > 0 and all_issues_closed \
|
||||
and all_tasks_closed and all_us_closed
|
||||
tasks_check = milestone.tasks.all().count() > 0 and all_tasks_closed \
|
||||
and all_issues_closed and all_us_closed
|
||||
|
||||
return uss_check or issues_check or tasks_check
|
||||
return (milestone.user_stories.all().count() > 0 and
|
||||
all([task.status is not None and task.status.is_closed for task in milestone.tasks.all()]) and
|
||||
all([user_story.is_closed for user_story in milestone.user_stories.all()]))
|
||||
|
||||
|
||||
def close_milestone(milestone):
|
||||
|
@ -51,137 +38,3 @@ def open_milestone(milestone):
|
|||
if milestone.closed:
|
||||
milestone.closed = False
|
||||
milestone.save(update_fields=["closed",])
|
||||
|
||||
|
||||
def update_userstories_milestone_in_bulk(bulk_data: list, milestone: object):
|
||||
"""
|
||||
Update the milestone and the milestone order of some user stories adding
|
||||
the extra orders needed to keep consistency.
|
||||
`bulk_data` should be a list of dicts with the following format:
|
||||
[{'us_id': <value>, 'order': <value>}, ...]
|
||||
"""
|
||||
user_stories = milestone.user_stories.all()
|
||||
us_orders = {us.id: getattr(us, "sprint_order") for us in user_stories}
|
||||
new_us_orders = {}
|
||||
for e in bulk_data:
|
||||
new_us_orders[e["us_id"]] = e["order"]
|
||||
# The base orders where we apply the new orders must containg all
|
||||
# the values
|
||||
us_orders[e["us_id"]] = e["order"]
|
||||
|
||||
apply_order_updates(us_orders, new_us_orders)
|
||||
|
||||
us_milestones = {e["us_id"]: milestone.id for e in bulk_data}
|
||||
user_story_ids = us_milestones.keys()
|
||||
|
||||
events.emit_event_for_ids(ids=user_story_ids,
|
||||
content_type="userstories.userstory",
|
||||
projectid=milestone.project.pk)
|
||||
|
||||
us_instance_list = []
|
||||
us_values = []
|
||||
for us_id in user_story_ids:
|
||||
us = UserStory.objects.get(pk=us_id)
|
||||
us_instance_list.append(us)
|
||||
us_values.append({'milestone_id': milestone.id})
|
||||
|
||||
db.update_in_bulk(us_instance_list, us_values)
|
||||
db.update_attr_in_bulk_for_ids(us_orders, "sprint_order", UserStory)
|
||||
|
||||
# Updating the milestone for the tasks
|
||||
Task.objects.filter(
|
||||
user_story_id__in=[e["us_id"] for e in bulk_data]).update(
|
||||
milestone=milestone)
|
||||
|
||||
return us_orders
|
||||
|
||||
|
||||
def snapshot_userstories_in_bulk(bulk_data, user):
|
||||
for us_data in bulk_data:
|
||||
try:
|
||||
us = UserStory.objects.get(pk=us_data['us_id'])
|
||||
take_snapshot(us, user=user)
|
||||
except UserStory.DoesNotExist:
|
||||
pass
|
||||
|
||||
|
||||
def update_tasks_milestone_in_bulk(bulk_data: list, milestone: object):
|
||||
"""
|
||||
Update the milestone and the milestone order of some tasks adding
|
||||
the extra orders needed to keep consistency.
|
||||
`bulk_data` should be a list of dicts with the following format:
|
||||
[{'task_id': <value>, 'order': <value>}, ...]
|
||||
"""
|
||||
tasks = milestone.tasks.all()
|
||||
task_orders = {task.id: getattr(task, "taskboard_order") for task in tasks}
|
||||
new_task_orders = {}
|
||||
for e in bulk_data:
|
||||
new_task_orders[e["task_id"]] = e["order"]
|
||||
# The base orders where we apply the new orders must containg all
|
||||
# the values
|
||||
task_orders[e["task_id"]] = e["order"]
|
||||
|
||||
apply_order_updates(task_orders, new_task_orders)
|
||||
|
||||
task_milestones = {e["task_id"]: milestone.id for e in bulk_data}
|
||||
task_ids = task_milestones.keys()
|
||||
|
||||
events.emit_event_for_ids(ids=task_ids,
|
||||
content_type="tasks.task",
|
||||
projectid=milestone.project.pk)
|
||||
|
||||
|
||||
task_instance_list = []
|
||||
task_values = []
|
||||
for task_id in task_ids:
|
||||
task = Task.objects.get(pk=task_id)
|
||||
task_instance_list.append(task)
|
||||
task_values.append({'milestone_id': milestone.id})
|
||||
|
||||
db.update_in_bulk(task_instance_list, task_values)
|
||||
db.update_attr_in_bulk_for_ids(task_orders, "taskboard_order", Task)
|
||||
|
||||
return task_milestones
|
||||
|
||||
|
||||
def snapshot_tasks_in_bulk(bulk_data, user):
|
||||
for task_data in bulk_data:
|
||||
try:
|
||||
task = Task.objects.get(pk=task_data['task_id'])
|
||||
take_snapshot(task, user=user)
|
||||
except Task.DoesNotExist:
|
||||
pass
|
||||
|
||||
|
||||
def update_issues_milestone_in_bulk(bulk_data: list, milestone: object):
|
||||
"""
|
||||
Update the milestone some issues adding
|
||||
`bulk_data` should be a list of dicts with the following format:
|
||||
[{'task_id': <value>}, ...]
|
||||
"""
|
||||
issue_milestones = {e["issue_id"]: milestone.id for e in bulk_data}
|
||||
issue_ids = issue_milestones.keys()
|
||||
|
||||
events.emit_event_for_ids(ids=issue_ids,
|
||||
content_type="issues.issues",
|
||||
projectid=milestone.project.pk)
|
||||
|
||||
issues_instance_list = []
|
||||
issues_values = []
|
||||
for issue_id in issue_ids:
|
||||
issue = Issue.objects.get(pk=issue_id)
|
||||
issues_instance_list.append(issue)
|
||||
issues_values.append({'milestone_id': milestone.id})
|
||||
|
||||
db.update_in_bulk(issues_instance_list, issues_values)
|
||||
|
||||
return issue_milestones
|
||||
|
||||
|
||||
def snapshot_issues_in_bulk(bulk_data, user):
|
||||
for issue_data in bulk_data:
|
||||
try:
|
||||
issue = Issue.objects.get(pk=issue_data['issue_id'])
|
||||
take_snapshot(issue, user=user)
|
||||
except Issue.DoesNotExist:
|
||||
pass
|
||||
|
|
|
@ -19,17 +19,15 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
|
||||
from taiga.base.exceptions import ValidationError
|
||||
from taiga.base.api import serializers
|
||||
from taiga.base.api import validators
|
||||
from taiga.projects.notifications.validators import WatchersValidator
|
||||
from taiga.projects.userstories.models import UserStory
|
||||
from taiga.projects.validators import DuplicatedNameInProjectValidator
|
||||
from taiga.projects.validators import ProjectExistsValidator
|
||||
from taiga.projects.notifications.validators import WatchersValidator
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
class MilestoneExistsValidator:
|
||||
def validate_milestone_id(self, attrs, source):
|
||||
def validate_sprint_id(self, attrs, source):
|
||||
value = attrs[source]
|
||||
if not models.Milestone.objects.filter(pk=value).exists():
|
||||
msg = _("There's no milestone with that id")
|
||||
|
@ -41,28 +39,3 @@ class MilestoneValidator(WatchersValidator, DuplicatedNameInProjectValidator, va
|
|||
class Meta:
|
||||
model = models.Milestone
|
||||
read_only_fields = ("id", "created_date", "modified_date")
|
||||
|
||||
|
||||
# bulk validators
|
||||
class _UserStoryMilestoneBulkValidator(validators.Validator):
|
||||
us_id = serializers.IntegerField()
|
||||
order = serializers.IntegerField()
|
||||
|
||||
|
||||
class UpdateMilestoneBulkValidator(MilestoneExistsValidator,
|
||||
ProjectExistsValidator,
|
||||
validators.Validator):
|
||||
project_id = serializers.IntegerField()
|
||||
milestone_id = serializers.IntegerField()
|
||||
bulk_stories = _UserStoryMilestoneBulkValidator(many=True)
|
||||
|
||||
def validate_bulk_stories(self, attrs, source):
|
||||
filters = {
|
||||
"project__id": attrs["project_id"],
|
||||
"id__in": [us["us_id"] for us in attrs[source]]
|
||||
}
|
||||
|
||||
if UserStory.objects.filter(**filters).count() != len(filters["id__in"]):
|
||||
raise ValidationError(_("All the user stories must be from the same project"))
|
||||
|
||||
return attrs
|
||||
|
|
|
@ -605,31 +605,8 @@ class Points(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
class UserStoryDueDate(models.Model):
|
||||
name = models.CharField(max_length=255, null=False, blank=False,
|
||||
verbose_name=_("name"))
|
||||
order = models.IntegerField(default=10, null=False, blank=False,
|
||||
verbose_name=_("order"))
|
||||
by_default = models.BooleanField(default=False, null=False, blank=True,
|
||||
verbose_name=_("by default"))
|
||||
color = models.CharField(max_length=20, null=False, blank=False, default="#999999",
|
||||
verbose_name=_("color"))
|
||||
days_to_due = models.IntegerField(null=True, blank=True, default=None,
|
||||
verbose_name=_("days to due"))
|
||||
project = models.ForeignKey("Project", null=False, blank=False,
|
||||
related_name="us_duedates", verbose_name=_("project"))
|
||||
|
||||
class Meta:
|
||||
verbose_name = "user story due date"
|
||||
verbose_name_plural = "user story due dates"
|
||||
ordering = ["project", "order", "name"]
|
||||
unique_together = ("project", "name")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
# Tasks common models
|
||||
|
||||
class TaskStatus(models.Model):
|
||||
name = models.CharField(max_length=255, null=False, blank=False,
|
||||
verbose_name=_("name"))
|
||||
|
@ -662,30 +639,6 @@ class TaskStatus(models.Model):
|
|||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class TaskDueDate(models.Model):
|
||||
name = models.CharField(max_length=255, null=False, blank=False,
|
||||
verbose_name=_("name"))
|
||||
order = models.IntegerField(default=10, null=False, blank=False,
|
||||
verbose_name=_("order"))
|
||||
by_default = models.BooleanField(default=False, null=False, blank=True,
|
||||
verbose_name=_("by default"))
|
||||
color = models.CharField(max_length=20, null=False, blank=False, default="#999999",
|
||||
verbose_name=_("color"))
|
||||
days_to_due = models.IntegerField(null=True, blank=True, default=None,
|
||||
verbose_name=_("days to due"))
|
||||
project = models.ForeignKey("Project", null=False, blank=False,
|
||||
related_name="task_duedates", verbose_name=_("project"))
|
||||
|
||||
class Meta:
|
||||
verbose_name = "task due date"
|
||||
verbose_name_plural = "task due dates"
|
||||
ordering = ["project", "order", "name"]
|
||||
unique_together = (("project", "name"))
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
# Issue common Models
|
||||
|
||||
class Priority(models.Model):
|
||||
|
@ -780,30 +733,6 @@ class IssueType(models.Model):
|
|||
return self.name
|
||||
|
||||
|
||||
class IssueDueDate(models.Model):
|
||||
name = models.CharField(max_length=255, null=False, blank=False,
|
||||
verbose_name=_("name"))
|
||||
order = models.IntegerField(default=10, null=False, blank=False,
|
||||
verbose_name=_("order"))
|
||||
by_default = models.BooleanField(default=False, null=False, blank=True,
|
||||
verbose_name=_("by default"))
|
||||
color = models.CharField(max_length=20, null=False, blank=False, default="#999999",
|
||||
verbose_name=_("color"))
|
||||
days_to_due = models.IntegerField(null=True, blank=True, default=None,
|
||||
verbose_name=_("days to due"))
|
||||
project = models.ForeignKey("Project", null=False, blank=False,
|
||||
related_name="issue_duedates", verbose_name=_("project"))
|
||||
|
||||
class Meta:
|
||||
verbose_name = "issue due date"
|
||||
verbose_name_plural = "issue due dates"
|
||||
ordering = ["project", "order", "name"]
|
||||
unique_together = ("project", "name")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
||||
name = models.CharField(max_length=250, null=False, blank=False,
|
||||
verbose_name=_("name"))
|
||||
|
@ -846,13 +775,10 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
default_options = JSONField(null=True, blank=True, verbose_name=_("default options"))
|
||||
epic_statuses = JSONField(null=True, blank=True, verbose_name=_("epic statuses"))
|
||||
us_statuses = JSONField(null=True, blank=True, verbose_name=_("us statuses"))
|
||||
us_duedates = JSONField(null=True, blank=True, verbose_name=_("us duedates"))
|
||||
points = JSONField(null=True, blank=True, verbose_name=_("points"))
|
||||
task_statuses = JSONField(null=True, blank=True, verbose_name=_("task statuses"))
|
||||
task_duedates = JSONField(null=True, blank=True, verbose_name=_("task duedates"))
|
||||
issue_statuses = JSONField(null=True, blank=True, verbose_name=_("issue statuses"))
|
||||
issue_types = JSONField(null=True, blank=True, verbose_name=_("issue types"))
|
||||
issue_duedates = JSONField(null=True, blank=True, verbose_name=_("issue duedates"))
|
||||
priorities = JSONField(null=True, blank=True, verbose_name=_("priorities"))
|
||||
severities = JSONField(null=True, blank=True, verbose_name=_("severities"))
|
||||
roles = JSONField(null=True, blank=True, verbose_name=_("roles"))
|
||||
|
@ -924,16 +850,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
"order": us_status.order,
|
||||
})
|
||||
|
||||
self.us_duedates = []
|
||||
for us_duedate in project.us_duedates.all():
|
||||
self.us_duedates.append({
|
||||
"name": us_duedate.name,
|
||||
"by_default": us_duedate.by_default,
|
||||
"color": us_duedate.color,
|
||||
"days_to_due": us_duedate.days_to_due,
|
||||
"order": us_duedate.order,
|
||||
})
|
||||
|
||||
self.points = []
|
||||
for us_point in project.points.all():
|
||||
self.points.append({
|
||||
|
@ -952,16 +868,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
"order": task_status.order,
|
||||
})
|
||||
|
||||
self.task_duedates = []
|
||||
for task_duedate in project.task_duedates.all():
|
||||
self.task_duedates.append({
|
||||
"name": task_duedate.name,
|
||||
"by_default": task_duedate.by_default,
|
||||
"color": task_duedate.color,
|
||||
"days_to_due": task_duedate.days_to_due,
|
||||
"order": task_duedate.order,
|
||||
})
|
||||
|
||||
self.issue_statuses = []
|
||||
for issue_status in project.issue_statuses.all():
|
||||
self.issue_statuses.append({
|
||||
|
@ -980,16 +886,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
"order": issue_type.order,
|
||||
})
|
||||
|
||||
self.issue_duedates = []
|
||||
for issue_duedate in project.issue_duedates.all():
|
||||
self.issue_duedates.append({
|
||||
"name": issue_duedate.name,
|
||||
"by_default": issue_duedate.by_default,
|
||||
"color": issue_duedate.color,
|
||||
"days_to_due": issue_duedate.days_to_due,
|
||||
"order": issue_duedate.order,
|
||||
})
|
||||
|
||||
self.priorities = []
|
||||
for priority in project.priorities.all():
|
||||
self.priorities.append({
|
||||
|
@ -1101,16 +997,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
project=project
|
||||
)
|
||||
|
||||
for us_duedate in self.us_duedates:
|
||||
UserStoryDueDate.objects.create(
|
||||
name=us_duedate["name"],
|
||||
by_default=us_duedate["by_default"],
|
||||
color=us_duedate["color"],
|
||||
days_to_due=us_duedate["days_to_due"],
|
||||
order=us_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
|
||||
for point in self.points:
|
||||
Points.objects.create(
|
||||
name=point["name"],
|
||||
|
@ -1129,16 +1015,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
project=project
|
||||
)
|
||||
|
||||
for task_duedate in self.task_duedates:
|
||||
TaskDueDate.objects.create(
|
||||
name=task_duedate["name"],
|
||||
by_default=task_duedate["by_default"],
|
||||
color=task_duedate["color"],
|
||||
days_to_due=task_duedate["days_to_due"],
|
||||
order=task_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
|
||||
for issue_status in self.issue_statuses:
|
||||
IssueStatus.objects.create(
|
||||
name=issue_status["name"],
|
||||
|
@ -1157,16 +1033,6 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
project=project
|
||||
)
|
||||
|
||||
for issue_duedate in self.issue_duedates:
|
||||
IssueDueDate.objects.create(
|
||||
name=issue_duedate["name"],
|
||||
by_default=issue_duedate["by_default"],
|
||||
color=issue_duedate["color"],
|
||||
days_to_due=issue_duedate["days_to_due"],
|
||||
order=issue_duedate["order"],
|
||||
project=project
|
||||
)
|
||||
|
||||
for priority in self.priorities:
|
||||
Priority.objects.create(
|
||||
name=priority["name"],
|
||||
|
@ -1196,6 +1062,7 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
if self.epic_statuses:
|
||||
project.default_epic_status = EpicStatus.objects.get(name=self.default_options["epic_status"],
|
||||
project=project)
|
||||
|
||||
if self.us_statuses:
|
||||
project.default_us_status = UserStoryStatus.objects.get(name=self.default_options["us_status"],
|
||||
project=project)
|
||||
|
@ -1209,12 +1076,15 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model):
|
|||
if self.issue_statuses:
|
||||
project.default_issue_status = IssueStatus.objects.get(name=self.default_options["issue_status"],
|
||||
project=project)
|
||||
|
||||
if self.issue_types:
|
||||
project.default_issue_type = IssueType.objects.get(name=self.default_options["issue_type"],
|
||||
project=project)
|
||||
|
||||
if self.priorities:
|
||||
project.default_priority = Priority.objects.get(name=self.default_options["priority"],
|
||||
project=project)
|
||||
|
||||
if self.severities:
|
||||
project.default_severity = Severity.objects.get(name=self.default_options["severity"],
|
||||
project=project)
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2018 Taiga Agile LLC
|
||||
# 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/>.
|
||||
|
||||
default_app_config = "taiga.projects.notifications.apps.NotificationsAppConfig"
|
|
@ -17,12 +17,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.db.models import Q
|
||||
from django.utils import timezone
|
||||
|
||||
from taiga.base import response
|
||||
from taiga.base.api import ModelCrudViewSet
|
||||
from taiga.base.api import GenericViewSet
|
||||
from taiga.base.api.utils import get_object_or_404
|
||||
|
||||
from taiga.projects.notifications.choices import NotifyLevel
|
||||
from taiga.projects.models import Project
|
||||
|
@ -54,53 +50,3 @@ class NotifyPolicyViewSet(ModelCrudViewSet):
|
|||
return models.NotifyPolicy.objects.filter(user=self.request.user).filter(
|
||||
Q(project__owner=self.request.user) | Q(project__memberships__user=self.request.user)
|
||||
).distinct()
|
||||
|
||||
|
||||
class WebNotificationsViewSet(GenericViewSet):
|
||||
serializer_class = serializers.WebNotificationSerializer
|
||||
resource_model = models.WebNotification
|
||||
|
||||
def check_permissions(self, request, obj=None):
|
||||
return obj and request.user.is_authenticated() and \
|
||||
request.user.pk == obj.user_id
|
||||
|
||||
def list(self, request):
|
||||
if self.request.user.is_anonymous():
|
||||
return response.Ok({})
|
||||
|
||||
queryset = models.WebNotification.objects\
|
||||
.filter(user=self.request.user)
|
||||
|
||||
if request.GET.get("only_unread", False):
|
||||
queryset = queryset.filter(read__isnull=True)
|
||||
|
||||
queryset = queryset.order_by('-read', '-created')
|
||||
|
||||
page = self.paginate_queryset(queryset)
|
||||
if page is not None:
|
||||
serializer = self.get_pagination_serializer(page)
|
||||
return response.Ok({
|
||||
"objects": serializer.data,
|
||||
"total": queryset.count()
|
||||
})
|
||||
|
||||
serializer = self.get_serializer(queryset, many=True)
|
||||
return response.Ok(serializer.data)
|
||||
|
||||
def patch(self, request, *args, **kwargs):
|
||||
self.check_permissions(request)
|
||||
|
||||
resource_id = kwargs.get("resource_id", None)
|
||||
resource = get_object_or_404(self.resource_model, pk=resource_id)
|
||||
resource.read = timezone.now()
|
||||
resource.save()
|
||||
|
||||
return response.Ok({})
|
||||
|
||||
def post(self, request):
|
||||
self.check_permissions(request)
|
||||
|
||||
models.WebNotification.objects.filter(user=self.request.user)\
|
||||
.update(read=timezone.now())
|
||||
|
||||
return response.Ok()
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2018 Taiga Agile LLC
|
||||
# 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 import dispatch
|
||||
from django.apps import AppConfig
|
||||
|
||||
signal_assigned_to = dispatch.Signal(providing_args=["user", "obj"])
|
||||
signal_assigned_users = dispatch.Signal(providing_args=["user", "obj",
|
||||
"new_assigned_users"])
|
||||
signal_watchers_added = dispatch.Signal(providing_args=["user", "obj",
|
||||
"new_watchers"])
|
||||
signal_members_added = dispatch.Signal(providing_args=["user", "project",
|
||||
"new_members"])
|
||||
signal_mentions = dispatch.Signal(providing_args=["user", "obj",
|
||||
"mentions"])
|
||||
signal_comment = dispatch.Signal(providing_args=["user", "obj",
|
||||
"watchers"])
|
||||
signal_comment_mentions = dispatch.Signal(providing_args=["user", "obj",
|
||||
"mentions"])
|
||||
|
||||
|
||||
class NotificationsAppConfig(AppConfig):
|
||||
name = "taiga.projects.notifications"
|
||||
verbose_name = "Notifications"
|
||||
|
||||
def ready(self):
|
||||
from . import signals as handlers
|
||||
signal_assigned_to.connect(handlers.on_assigned_to)
|
||||
signal_assigned_users.connect(handlers.on_assigned_users)
|
||||
signal_watchers_added.connect(handlers.on_watchers_added)
|
||||
signal_members_added.connect(handlers.on_members_added)
|
||||
signal_mentions.connect(handlers.on_mentions)
|
||||
signal_comment.connect(handlers.on_comment)
|
||||
signal_comment_mentions.connect(handlers.on_comment_mentions)
|
|
@ -31,22 +31,3 @@ NOTIFY_LEVEL_CHOICES = (
|
|||
(NotifyLevel.all, _("All")),
|
||||
(NotifyLevel.none, _("None")),
|
||||
)
|
||||
|
||||
|
||||
class WebNotificationType(enum.IntEnum):
|
||||
assigned = 1
|
||||
mentioned = 2
|
||||
added_as_watcher = 3
|
||||
added_as_member = 4
|
||||
comment = 5
|
||||
mentioned_in_comment = 6
|
||||
|
||||
|
||||
WEB_NOTIFICATION_TYPE_CHOICES = (
|
||||
(WebNotificationType.assigned, _("Assigned")),
|
||||
(WebNotificationType.mentioned, _("Mentioned")),
|
||||
(WebNotificationType.added_as_watcher, _("Added as watcher")),
|
||||
(WebNotificationType.added_as_member, _("Added as member")),
|
||||
(WebNotificationType.comment, _("Comment")),
|
||||
(WebNotificationType.mentioned_in_comment, _("Mentioned in comment")),
|
||||
)
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2018-10-10 11:24
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
import django.core.serializers.json
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import taiga.base.db.models.fields.json
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('notifications', '0007_notifypolicy_live_notify_level'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='WebNotification',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
|
||||
('read', models.DateTimeField(default=None, null=True)),
|
||||
('event_type', models.PositiveIntegerField()),
|
||||
('data', taiga.base.db.models.fields.json.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='web_notifications', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='notifypolicy',
|
||||
name='web_notify_level',
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
|
@ -29,12 +29,6 @@ from taiga.base.api.utils import get_object_or_404
|
|||
from taiga.base.fields import WatchersField, MethodField
|
||||
from taiga.projects.notifications import services
|
||||
|
||||
from . apps import signal_assigned_to
|
||||
from . apps import signal_assigned_users
|
||||
from . apps import signal_comment
|
||||
from . apps import signal_comment_mentions
|
||||
from . apps import signal_mentions
|
||||
from . apps import signal_watchers_added
|
||||
from . serializers import WatcherSerializer
|
||||
|
||||
|
||||
|
@ -53,8 +47,6 @@ class WatchedResourceMixin:
|
|||
"""
|
||||
|
||||
_not_notify = False
|
||||
_old_watchers = None
|
||||
_old_mentions = []
|
||||
|
||||
@detail_route(methods=["POST"])
|
||||
def watch(self, request, pk=None):
|
||||
|
@ -94,38 +86,13 @@ class WatchedResourceMixin:
|
|||
# some text fields for extract mentions and add them
|
||||
# to watchers before obtain a complete list of
|
||||
# notifiable users.
|
||||
services.analize_object_for_watchers(obj, history.comment,
|
||||
history.owner)
|
||||
services.analize_object_for_watchers(obj, history.comment, history.owner)
|
||||
|
||||
# Get a complete list of notifiable users for current
|
||||
# object and send the change notification to them.
|
||||
services.send_notifications(obj, history=history)
|
||||
|
||||
def update(self, request, *args, **kwargs):
|
||||
obj = self.get_object_or_none()
|
||||
if obj and obj.id:
|
||||
if hasattr(obj, "watchers"):
|
||||
self._old_watchers = [
|
||||
watcher.id for watcher in self.get_object().get_watchers()
|
||||
]
|
||||
|
||||
mention_fields = ['description', 'content']
|
||||
for field_name in mention_fields:
|
||||
old_mentions = self._get_old_mentions_in_field(obj, field_name)
|
||||
if not len(old_mentions):
|
||||
continue
|
||||
self._old_mentions = old_mentions
|
||||
|
||||
return super().update(request, *args, **kwargs)
|
||||
|
||||
def post_save(self, obj, created=False):
|
||||
self.create_web_notifications_for_added_watchers(obj)
|
||||
self.create_web_notifications_for_mentioned_users(obj)
|
||||
|
||||
mentions = self.create_web_notifications_for_mentions_in_comments(obj)
|
||||
exclude = mentions + [self.request.user.id]
|
||||
self.create_web_notifications_for_comment(obj, exclude)
|
||||
|
||||
self.send_notifications(obj)
|
||||
super().post_save(obj, created)
|
||||
|
||||
|
@ -133,84 +100,6 @@ class WatchedResourceMixin:
|
|||
self.send_notifications(obj)
|
||||
super().pre_delete(obj)
|
||||
|
||||
def create_web_notifications_for_comment(self, obj, exclude: list=None):
|
||||
if "comment" in self.request.DATA:
|
||||
watchers = [
|
||||
watcher_id for watcher_id in obj.watchers
|
||||
if watcher_id not in exclude
|
||||
]
|
||||
|
||||
signal_comment.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
watchers=watchers)
|
||||
|
||||
def create_web_notifications_for_added_watchers(self, obj):
|
||||
if not hasattr(obj, "watchers"):
|
||||
return
|
||||
|
||||
new_watchers = [
|
||||
watcher_id for watcher_id in obj.watchers
|
||||
if watcher_id not in self._old_watchers
|
||||
and watcher_id != self.request.user.id
|
||||
]
|
||||
signal_watchers_added.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
new_watchers=new_watchers)
|
||||
|
||||
def create_web_notifications_for_mentioned_users(self, obj):
|
||||
"""
|
||||
Detect and notify mentioned users
|
||||
"""
|
||||
submitted_mentions = self._get_submitted_mentions(obj)
|
||||
new_mentions = list(set(submitted_mentions) - set(self._old_mentions))
|
||||
if new_mentions:
|
||||
signal_mentions.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
mentions=new_mentions)
|
||||
|
||||
def create_web_notifications_for_mentions_in_comments(self, obj):
|
||||
"""
|
||||
Detect and notify mentioned users
|
||||
"""
|
||||
new_mentions_in_comment = self._get_mentions_in_comment(obj)
|
||||
if new_mentions_in_comment:
|
||||
signal_comment_mentions.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
mentions=new_mentions_in_comment)
|
||||
|
||||
return [user.id for user in new_mentions_in_comment]
|
||||
|
||||
def _get_submitted_mentions(self, obj):
|
||||
mention_fields = ['description', 'content']
|
||||
for field_name in mention_fields:
|
||||
new_mentions = self._get_new_mentions_in_field(obj, field_name)
|
||||
if len(new_mentions) > 0:
|
||||
return new_mentions
|
||||
|
||||
return []
|
||||
|
||||
def _get_mentions_in_comment(self, obj):
|
||||
comment = self.request.DATA.get('comment')
|
||||
if comment:
|
||||
return services.get_mentions(obj, comment)
|
||||
return []
|
||||
|
||||
def _get_old_mentions_in_field(self, obj, field_name):
|
||||
if not hasattr(obj, field_name):
|
||||
return []
|
||||
|
||||
return services.get_mentions(obj, getattr(obj, field_name))
|
||||
|
||||
def _get_new_mentions_in_field(self, obj, field_name):
|
||||
value = self.request.DATA.get(field_name)
|
||||
if not value:
|
||||
return []
|
||||
return services.get_mentions(obj, value)
|
||||
|
||||
|
||||
class WatchedModelMixin(object):
|
||||
"""
|
||||
|
@ -385,47 +274,3 @@ class WatchersViewSetMixin:
|
|||
def get_queryset(self):
|
||||
resource = self.resource_model.objects.get(pk=self.kwargs.get("resource_id"))
|
||||
return resource.get_watchers()
|
||||
|
||||
|
||||
class AssignedToSignalMixin:
|
||||
_old_assigned_to = None
|
||||
|
||||
def pre_save(self, obj):
|
||||
if obj.id:
|
||||
self._old_assigned_to = self.get_object().assigned_to
|
||||
super().pre_save(obj)
|
||||
|
||||
def post_save(self, obj, created=False):
|
||||
if obj.assigned_to and obj.assigned_to != self._old_assigned_to \
|
||||
and self.request.user != obj.assigned_to:
|
||||
signal_assigned_to.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj)
|
||||
super().post_save(obj, created)
|
||||
|
||||
|
||||
class AssignedUsersSignalMixin:
|
||||
_old_assigned_users = None
|
||||
|
||||
def update(self, request, *args, **kwargs):
|
||||
obj = self.get_object_or_none()
|
||||
if hasattr(obj, "assigned_users") and obj.id:
|
||||
self._old_assigned_users = [
|
||||
user for user in obj.assigned_users.all()
|
||||
].copy()
|
||||
|
||||
result = super().update(request, *args, **kwargs)
|
||||
|
||||
if result and obj.assigned_users:
|
||||
new_assigned_users = [
|
||||
user for user in obj.assigned_users.all()
|
||||
if user not in self._old_assigned_users
|
||||
and user != self.request.user
|
||||
]
|
||||
|
||||
signal_assigned_users.send(sender=self.__class__,
|
||||
user=self.request.user,
|
||||
obj=obj,
|
||||
new_assigned_users=new_assigned_users)
|
||||
|
||||
return result
|
||||
|
|
|
@ -23,7 +23,6 @@ from django.db import models
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils import timezone
|
||||
|
||||
from taiga.base.db.models.fields import JSONField
|
||||
from taiga.projects.history.choices import HISTORY_TYPE_CHOICES
|
||||
|
||||
from .choices import NOTIFY_LEVEL_CHOICES, NotifyLevel
|
||||
|
@ -38,7 +37,6 @@ class NotifyPolicy(models.Model):
|
|||
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="notify_policies")
|
||||
notify_level = models.SmallIntegerField(choices=NOTIFY_LEVEL_CHOICES)
|
||||
live_notify_level = models.SmallIntegerField(choices=NOTIFY_LEVEL_CHOICES, default=NotifyLevel.involved)
|
||||
web_notify_level = models.BooleanField(default=True, null=False, blank=True)
|
||||
|
||||
created_at = models.DateTimeField(default=timezone.now)
|
||||
modified_at = models.DateTimeField()
|
||||
|
@ -96,11 +94,3 @@ class Watched(models.Model):
|
|||
verbose_name = _("Watched")
|
||||
verbose_name_plural = _("Watched")
|
||||
unique_together = ("content_type", "object_id", "user", "project")
|
||||
|
||||
|
||||
class WebNotification(models.Model):
|
||||
created = models.DateTimeField(default=timezone.now, db_index=True)
|
||||
read = models.DateTimeField(default=None, null=True)
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="web_notifications")
|
||||
event_type = models.PositiveIntegerField()
|
||||
data = JSONField()
|
||||
|
|
|
@ -16,13 +16,8 @@
|
|||
# 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.contenttypes.models import ContentType
|
||||
|
||||
from taiga.base.api import serializers
|
||||
from taiga.base.fields import Field, DateTimeField, MethodField
|
||||
from taiga.users.gravatar import get_user_gravatar_id
|
||||
from taiga.users.models import get_user_model_safe
|
||||
from taiga.users.services import get_user_photo_url, get_user_big_photo_url
|
||||
|
||||
from . import models
|
||||
|
||||
|
@ -32,8 +27,7 @@ class NotifyPolicySerializer(serializers.ModelSerializer):
|
|||
|
||||
class Meta:
|
||||
model = models.NotifyPolicy
|
||||
fields = ('id', 'project', 'project_name', 'notify_level',
|
||||
'live_notify_level', 'web_notify_level')
|
||||
fields = ('id', 'project', 'project_name', 'notify_level', "live_notify_level")
|
||||
|
||||
def get_project_name(self, obj):
|
||||
return obj.project.name
|
||||
|
@ -45,67 +39,3 @@ class WatcherSerializer(serializers.ModelSerializer):
|
|||
class Meta:
|
||||
model = get_user_model_safe()
|
||||
fields = ('id', 'username', 'full_name')
|
||||
|
||||
|
||||
class WebNotificationSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = models.WebNotification
|
||||
fields = ('id', 'event_type', 'user', 'data', 'created', 'read')
|
||||
|
||||
|
||||
class ProjectSerializer(serializers.LightSerializer):
|
||||
id = Field()
|
||||
slug = Field()
|
||||
name = Field()
|
||||
|
||||
|
||||
class ObjectSerializer(serializers.LightSerializer):
|
||||
id = Field()
|
||||
ref = MethodField()
|
||||
subject = MethodField()
|
||||
content_type = MethodField()
|
||||
|
||||
def get_ref(self, obj):
|
||||
return obj.ref if hasattr(obj, 'ref') else None
|
||||
|
||||
def get_subject(self, obj):
|
||||
return obj.subject if hasattr(obj, 'subject') else None
|
||||
|
||||
def get_content_type(self, obj):
|
||||
content_type = ContentType.objects.get_for_model(obj)
|
||||
return content_type.model if content_type else None
|
||||
|
||||
|
||||
class UserSerializer(serializers.LightSerializer):
|
||||
id = Field()
|
||||
name = MethodField()
|
||||
photo = MethodField()
|
||||
big_photo = MethodField()
|
||||
gravatar_id = MethodField()
|
||||
username = Field()
|
||||
is_profile_visible = MethodField()
|
||||
date_joined = DateTimeField()
|
||||
|
||||
def get_name(self, obj):
|
||||
return obj.get_full_name()
|
||||
|
||||
def get_photo(self, obj):
|
||||
return get_user_photo_url(obj)
|
||||
|
||||
def get_big_photo(self, obj):
|
||||
return get_user_big_photo_url(obj)
|
||||
|
||||
def get_gravatar_id(self, obj):
|
||||
return get_user_gravatar_id(obj)
|
||||
|
||||
def get_is_profile_visible(self, obj):
|
||||
return obj.is_active and not obj.is_system
|
||||
|
||||
|
||||
class NotificationDataSerializer(serializers.LightDictSerializer):
|
||||
project = ProjectSerializer()
|
||||
user = UserSerializer()
|
||||
|
||||
|
||||
class ObjectNotificationSerializer(NotificationDataSerializer):
|
||||
obj = ObjectSerializer()
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue