summaryrefslogtreecommitdiffstats
path: root/news
AgeCommit message (Collapse)AuthorFilesLines
2019-10-25news: Make the check for MAILMAN_PASSWORD backwards compatibleGiancarlo Razzolini1-4/+4
This makes the check work with previous versions of archweb while also taking into account downstreams that might not want or need this change.
2019-10-25news: Change the news app to use the EmailMessage class to be able to ↵Giancarlo Razzolini1-7/+11
include the mailman password Due to spamming to arch-announce mail list, we now use a poster password to make sure only authorized emails are allowed through to the list.
2019-02-09news: fix xml sitemapJelle van der Waa1-1/+5
Fix Exception Value: 'list' object has no attribute 'filter', probably introduced by running 2to3.
2019-01-21Fix tests for Python3 by decoding byteJelle van der Waa1-1/+1
2019-01-21Update migrations for Python 3Jelle van der Waa1-2/+2
2019-01-21Refactor Python 3 __unicode__ to __str__Frank Vanderham1-1/+1
In Python 3 for Django, class method __unicode__ must be changed to __str__. This commit replaces all models that use __unicode__ to __str__.
2019-01-21Remove all squashed migrationsJelle van der Waa3-59/+0
this makes it easier to upgrade to Python 3 since less on_delete lines have to be fixed.
2018-12-16Merge pull request #154 from jelly/squashmigrationsjelle van der Waa1-0/+42
squash all migrations
2018-11-20news: Add tests for all news functionalityJelle van der Waa1-1/+70
2018-11-17Squash all migrationsJelle van der Waa1-0/+42
2018-04-08treewide: context must be a dict rather than ContextJelle van der Waa1-3/+3
Passing Context has been removed in Django 11, a dict should rather be passed.
2018-04-08Update urls.py to non relative importsJelle van der Waa1-6/+4
2018-04-08Change urls.py from patterns to list of url()Johannes Löthberg1-10/+12
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-06-11tests: add tests for sitemapsJelle van der Waa1-0/+4
2017-06-11tests: test feedJelle van der Waa1-0/+7
2017-05-17Update news e-mail templaterelease_2017-05-17Angel Velasquez1-1/+1
Add missing quotes on the body.
2017-03-20news/views: Send e-mail to arch-announce on news creationGiancarlo Razzolini1-0/+12
When send_announce is True, we send an e-mail to the arch-announce mail list, containing the content of the news and the URL (slug to it).
2017-03-20news: Add send_announce to the modelGiancarlo Razzolini2-0/+21
Added a new send_announce boolean that controls if an e-mail containing the announce will or not be sent.
2014-12-08Upgrade to python-markdown 2.5.2Dan McGee2-8/+5
safe_mode is now deprecated, so adjust things accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-08Minor news listing tweaksDan McGee1-2/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-10-19Simplify last modified and etags processing for feedsDan McGee1-5/+2
We had this elaborate system set up with caching and invalidation, which is overkill since we cache the result of the view anyway. Just hit the database when needed to find the last change to the respective model class and be done with it. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01Add auto-generated migrations from new Django migrations frameworkDan McGee1-0/+37
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01Remove old south migrationsDan McGee12-814/+0
Django 1.7 has built-in migrations support, so we no longer want these around. All existing installs should be fully migrated at this point to the latest schema. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16Grab author when loading news item detailsDan McGee1-1/+1
Saves a query to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-31Minor news admin code cleanupDan McGee1-0/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Move slug creation helper to main/utilsDan McGee1-16/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-28Populate the todolist slug field and mark non-nullDan McGee1-2/+2
This is ripped off from commit 7c92ddbd3c86d when we added slugs to News objects. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-27Fix "RuntimeWarning: DateTimeField received a naive datetime" warningsDan McGee1-2/+2
When running tests, we can find old migrations that didn't use datetime objects with timezones attached. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-28Add safe_mode filter to news admin; preview uses safe modeDan McGee2-2/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-11Exclude news.safe_mode on news edit screenrelease_2012-11-11Dan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-01Allow editing news.safe_mode flag via admin screenDan McGee2-2/+3
We need to mark the property as editable, but you still don't have access to it through the normal non-admin views and edit screen. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-31Store 'safe_mode' attribute on news modelDan McGee3-1/+143
This lets us identify old news items that need to allow HTML through the markdown parser. For all new news items, we will disallow raw HTML. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-31Disable markdown safe modeDan McGee2-2/+2
Unless we want older news items to look like [HTML_REMOVED]this[HTML_REMOVED] all over the place. I'm tempted to mark old items as non-safe but enforce safe mode for all new news postings. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-26Remove usages of 'django.contrib.markup'Dan McGee2-1/+8
Switch to the news model being able to spit out the HTML version of the content, and don't use the markup contrib module. This is deprecated as of Django 1.5 so we can move off it now to save trouble down the road when it is fully removed. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-26Cleanup meta model attributesDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-26Enable safe mode for markdown parsingDan McGee1-1/+1
Although we don't allow unauthenticated users to post content, we should still cover our bases here and ensure people can't inject stuff into the production website via an inadvertent XSS. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Remove custom utc_now() function, use django.utils.timezone.now()Dan McGee1-6/+5
This was around from the time when we handled timezones sanely and Django did not; now that we are on 1.4 we no longer need our own code to handle this. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Ensure order_by default value is cleared when using distinct()Dan McGee1-1/+2
Otherwise the queryset returns nonsensical results. I find the design of this less than obvious but so be it; we can ensure the results work regardless of a default ordering on the model. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27Migrate news views to class-based generic viewsDan McGee2-74/+75
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-20Fix ContentType related migrationsDan McGee1-3/+8
This should fix the issues reported in FS#23228 for the most part. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08Add migrations for on_delete attributesDan McGee1-0/+65
I don't think these end up doing anything at the database level, but since South insists on generating alter_column() calls for these changes, do them once so they don't keep reappearing in auto-generated future migrations. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-23Make all datetime objects fully timezone awareDan McGee1-3/+4
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-23Change Django urls.py importDan McGee1-1/+1
Until Django 1.3, the functions include(), patterns() and url() plus handler404, handler500 were located in a django.conf.urls.defaults module. In Django 1.4, they live in django.conf.urls. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11Pylint suggested and other cleanupsDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07Utilize Django 1.3 'on_delete' feature on several foreign keysDan McGee1-1/+2
The most important one here is PROTECT to keep people from making bone-headed plays and deleting an Arch or Repo and every package along with it. We can use this in a few other places, as well as some carefully placed SET_NULL indicators. Note that nothing here pushes deletion responsibilities down to the database, although that will probably happen in a future commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07Consolidate caching black magicDan McGee1-2/+2
Get the stuff used to retrieve and refresh the latest date values all in the same place, and make it a bit more beautiful by refactoring it all into a common set of methods. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07Add some migrations to convert database to UTC timeDan McGee1-0/+85
This follows the earlier commit where we make sure any value going to or being pulled from the database is UTC. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07Use UTC datetime objects everywhereDan McGee1-1/+1
Rather than the twisted mix of local times and UTC times we currently have. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-07Ensure feed GUIDs are unchanging and uniqueDan McGee3-4/+168
Implement 'tag:' style URIs for the GUID field on our RSS feeds. This ensures new package updates show up as new, and we aren't jumping back and forth between generated GUIDs having 'http://' and 'https://' prefixes. Much of the work here is to attempt to keep old news GUIDs constant so we don't once again make everything show up as new in newsreaders. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-14Clean up news redirect argumentDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>