~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wiki/views.py

  • Committer: franku
  • Date: 2018-05-07 07:50:32 UTC
  • mto: This revision was merged to the branch mainline in revision 496.
  • Revision ID: somal@arcor.de-20180507075032-a04ywdyq0isvwy6f
Use a specialized conf.py and css for the website, so the widelands-repo isn't modified

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
            return redirect(new_article)
301
301
 
302
302
    elif request.method == 'GET':
 
303
        user_ip = get_real_ip(request)
303
304
 
304
305
        # TODO(Franku): Never worked IMHO
305
306
        # lock = cache.get(title, None)
306
307
        # if lock is None:
307
308
        #     lock = ArticleEditLock(title, request)
308
309
        # lock.create_message(request)
309
 
        initial = {}
 
310
 
 
311
        initial = {'user_ip': user_ip}
310
312
        if group_slug is not None:
311
313
            initial.update({'content_type': group_ct.id,
312
314
                            'object_id': group.id})
491
493
        except Article.DoesNotExist:
492
494
            # No existing article found -> reverting possible
493
495
            if request.user.is_authenticated:
494
 
                article.revert_to(revision, request.user)
 
496
                article.revert_to(revision, get_real_ip(request), request.user)
495
497
            else:
496
 
                article.revert_to(revision)
 
498
                article.revert_to(revision, get_real_ip(request))
497
499
            return redirect(article)
498
500
        # An article with this name exists
499
501
        messages.error(
671
673
 
672
674
    context = {'found_links': found_links,
673
675
               'found_old_links': found_old_links,
674
 
               'name': title,
675
 
               'article': this_article,
676
 
               }
 
676
               'name': title}
677
677
    return render(request, 'wiki/backlinks.html',
678
678
                              context,)