Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Add maintainer field to Page (#165)
Browse files Browse the repository at this point in the history
NOTE: when creating the column, make sure to specify a default
(1 should be fine, as that's the admin user).
  • Loading branch information
dellsystem committed Feb 10, 2013
1 parent 55ac445 commit 0403447
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions views/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ def create(request, department, number, page_type, semester=None):
else:
commit_message = request.POST['message'] if request.POST['message'] else 'Minor edit'
# The title and subject are generated by the PageType object, in kwargs
new_page = Page(course_sem=course_sem, page_type=page_type, **kwargs)
new_page.save()
new_page = Page.objects.create(course_sem=course_sem, page_type=page_type, maintainer=request.user, **kwargs)
username = request.user.username
email = request.user.email
new_page.save_content(request.POST['content'], commit_message, username)
Expand Down
2 changes: 2 additions & 0 deletions wiki/models/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os

from django.db import models
from django.contrib.auth.models import User

from wiki.utils.pages import page_types, page_type_choices, get_section_start_end
from wiki.utils.gitutils import Git
Expand All @@ -23,6 +24,7 @@ class Meta:
professor = models.ForeignKey('Professor', null=True, blank=True)
slug = models.CharField(max_length=50)
content = models.TextField(null=True) # processed markdown, like a cache
maintainer = models.ForeignKey(User)

def load_section_content(self, anchor_name):
"""
Expand Down

0 comments on commit 0403447

Please sign in to comment.