author | Lennard de Rijk <ljvderijk@gmail.com> |
Mon, 29 Jun 2009 23:16:21 +0200 | |
changeset 2452 | 4abc27894b61 |
parent 2177 | e2c193e1f631 |
child 2667 | 260aaea36e49 |
permissions | -rw-r--r-- |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
1308
35b75ffcbb37
Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1307
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
402
diff
changeset
|
17 |
"""Views for Host profiles. |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
429
e50e18936f06
Fixed typo in e-mail address
Sverre Rabbelier <srabbelier@gmail.com>
parents:
413
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
22 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
] |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
|
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
26 |
from django import forms |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
27 |
|
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
28 |
from soc.logic import cleaning |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
29 |
from soc.logic import dicts |
725
6180b32d990f
Filter the "list Hosts" view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
716
diff
changeset
|
30 |
from soc.logic.models import host as host_logic |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
31 |
from soc.logic.models import sponsor as sponsor_logic |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
32 |
from soc.views.helper import access |
1583 | 33 |
from soc.views.helper import decorators |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
34 |
from soc.views.helper import dynaform |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
35 |
from soc.views.helper import widgets |
494
5e9c656a1b68
Refactored SiteMap to be generic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
493
diff
changeset
|
36 |
from soc.views.models import role |
662
0e89b027b140
Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents:
657
diff
changeset
|
37 |
from soc.views.models import sponsor as sponsor_view |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
|
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
402
diff
changeset
|
39 |
import soc.models.host |
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
402
diff
changeset
|
40 |
import soc.logic.models.host |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
import soc.views.helper |
560
a32be584ee04
Requests are almost working now
Sverre Rabbelier <srabbelier@gmail.com>
parents:
554
diff
changeset
|
42 |
import soc.views.models.sponsor |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
43 |
|
725
6180b32d990f
Filter the "list Hosts" view
Sverre Rabbelier <srabbelier@gmail.com>
parents:
716
diff
changeset
|
44 |
|
657
c781de4f6d39
Rename role.RoleView to role.View
Sverre Rabbelier <srabbelier@gmail.com>
parents:
656
diff
changeset
|
45 |
class View(role.View): |
499
d22e4fe8e64b
Fix missing dots in doc strings and some other doc string corrections.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
497
diff
changeset
|
46 |
"""View methods for the Host model. |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
47 |
""" |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
48 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
49 |
def __init__(self, params=None): |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
50 |
"""Defines the fields and methods required for the base View class |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
51 |
to provide the user with list, public, create, edit and delete views. |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
52 |
|
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
53 |
Params: |
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
54 |
params: a dict with params for this View |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
55 |
""" |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
56 |
|
1007
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
998
diff
changeset
|
57 |
rights = access.Checker(params) |
1248
f318538394d9
Rename checkHasActiveRole to checkHasActiveRoleForScope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1203
diff
changeset
|
58 |
rights['create'] = [('checkHasActiveRoleForScope', host_logic.logic)] |
2018
c584eb2f57db
Added missing access checks to various roles.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
59 |
rights['edit'] = [('checkHasActiveRoleForScope', host_logic.logic), |
2020
df3552deba66
Clarified docstring in access.py and changed edit access checks for role views.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2018
diff
changeset
|
60 |
('checkIsMyEntity', [host_logic.logic, 'user', True])] |
1248
f318538394d9
Rename checkHasActiveRole to checkHasActiveRoleForScope
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1203
diff
changeset
|
61 |
rights['invite'] = [('checkHasActiveRoleForScope', host_logic.logic)] |
1007
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
998
diff
changeset
|
62 |
rights['list'] = ['checkIsDeveloper'] |
3b66772d21a5
Major refactor of the access module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
998
diff
changeset
|
63 |
rights['accept_invite'] = [('checkCanCreateFromRequest','host')] |
1661
1533893ed45a
Fix too long lines and remove unused imports in soc.views.models.host module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1584
diff
changeset
|
64 |
rights['process_request'] = [('checkHasActiveRoleForScope', |
1533893ed45a
Fix too long lines and remove unused imports in soc.views.models.host module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1584
diff
changeset
|
65 |
host_logic.logic), |
1163
d8c50be19232
Cleaned up access.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1076
diff
changeset
|
66 |
('checkCanProcessRequest','host')] |
d8c50be19232
Cleaned up access.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1076
diff
changeset
|
67 |
rights['manage'] = [('checkIsAllowedToManageRole', |
1184
bd9c6101d41d
Use .logic in checkIsAllowedToManageRole at the caller
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1163
diff
changeset
|
68 |
[host_logic.logic, host_logic.logic])] |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
69 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
70 |
new_params = {} |
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
71 |
new_params['rights'] = rights |
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
72 |
new_params['logic'] = soc.logic.models.host.logic |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
73 |
new_params['group_logic'] = sponsor_logic.logic |
990
fd1e6afb2d62
Added two needed redirects in role.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
969
diff
changeset
|
74 |
new_params['group_view'] = soc.views.models.sponsor.view |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
75 |
|
662
0e89b027b140
Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents:
657
diff
changeset
|
76 |
new_params['scope_view'] = sponsor_view |
0e89b027b140
Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents:
657
diff
changeset
|
77 |
|
716
26dc12dae79f
Changed "Sponsor" to "Program Owner"
Lennard de Rijk <ljvderijk@gmail.com>
parents:
710
diff
changeset
|
78 |
new_params['name'] = "Program Administrator" |
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
79 |
new_params['module_name'] = "host" |
1025
1f83f05f522b
Add grouping to the existing views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1007
diff
changeset
|
80 |
new_params['sidebar_grouping'] = 'Programs' |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
81 |
|
1076
063194eaf87b
Added agreed_to_tos_on field in user and role model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1067
diff
changeset
|
82 |
new_params['extra_dynaexclude'] = ['agreed_to_tos'] |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
83 |
|
1430
ff8cc6b15e6a
Rename dynafields to dynaproperties
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1384
diff
changeset
|
84 |
new_params['create_extra_dynaproperties'] = { |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
85 |
'scope_path': forms.CharField(widget=forms.HiddenInput, |
1163
d8c50be19232
Cleaned up access.py
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1076
diff
changeset
|
86 |
required=True), |
959
b6e8750c9407
Some style guide fixes, docstring fixes and removal of unused imports in different modules. Rename acceptInvite view variable to accept_invite in soc.views.models.host module to comply to our style guide.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
944
diff
changeset
|
87 |
'clean_link_id': cleaning.clean_existing_user('link_id'), |
b6e8750c9407
Some style guide fixes, docstring fixes and removal of unused imports in different modules. Rename acceptInvite view variable to accept_invite in soc.views.models.host module to comply to our style guide.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
944
diff
changeset
|
88 |
'clean_home_page': cleaning.clean_url('home_page'), |
b6e8750c9407
Some style guide fixes, docstring fixes and removal of unused imports in different modules. Rename acceptInvite view variable to accept_invite in soc.views.models.host module to comply to our style guide.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
944
diff
changeset
|
89 |
'clean_blog': cleaning.clean_url('blog'), |
b6e8750c9407
Some style guide fixes, docstring fixes and removal of unused imports in different modules. Rename acceptInvite view variable to accept_invite in soc.views.models.host module to comply to our style guide.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
944
diff
changeset
|
90 |
'clean_photo_url': cleaning.clean_url('photo_url')} |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
91 |
|
963
24c0a9da6360
Parameterized patterns in role.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
962
diff
changeset
|
92 |
new_params['allow_invites'] = True |
1384
bb22ea156567
Role overview membership is now determined by setting show_in_roles_overview param to true in the view.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1343
diff
changeset
|
93 |
new_params['show_in_roles_overview'] = True |
963
24c0a9da6360
Parameterized patterns in role.py.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
962
diff
changeset
|
94 |
|
656
a76f1b443ea4
Cleanups in the views module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
642
diff
changeset
|
95 |
params = dicts.merge(params, new_params) |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
96 |
|
657
c781de4f6d39
Rename role.RoleView to role.View
Sverre Rabbelier <srabbelier@gmail.com>
parents:
656
diff
changeset
|
97 |
super(View, self).__init__(params=params) |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
98 |
|
998
125257161908
Implemented the listing of all the roles in for a specific group.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
990
diff
changeset
|
99 |
# register the role with the group_view |
2177
e2c193e1f631
Do not rely on dicts.merge to change target
Sverre Rabbelier <srabbelier@gmail.com>
parents:
2020
diff
changeset
|
100 |
self._params['group_view'].registerRole(self._params['module_name'], self) |
998
125257161908
Implemented the listing of all the roles in for a specific group.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
990
diff
changeset
|
101 |
|
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
102 |
# create and store the special form for invited users |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
103 |
updated_fields = { |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
104 |
'link_id': forms.CharField(widget=widgets.ReadOnlyInput(), |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
105 |
required=False)} |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
106 |
|
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
107 |
invited_create_form = dynaform.extendDynaForm( |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
108 |
dynaform = self._params['create_form'], |
1430
ff8cc6b15e6a
Rename dynafields to dynaproperties
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1384
diff
changeset
|
109 |
dynaproperties = updated_fields) |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
110 |
|
2177
e2c193e1f631
Do not rely on dicts.merge to change target
Sverre Rabbelier <srabbelier@gmail.com>
parents:
2020
diff
changeset
|
111 |
self._params['invited_create_form'] = invited_create_form |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
112 |
|
575 | 113 |
def _editPost(self, request, entity, fields): |
114 |
"""See base.View._editPost(). |
|
115 |
""" |
|
969 | 116 |
if not entity: |
968
8177ddc9ea35
Fixed a bug in _editPost for club_admin and host.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
963
diff
changeset
|
117 |
fields['user'] = fields['link_id'] |
8177ddc9ea35
Fixed a bug in _editPost for club_admin and host.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
963
diff
changeset
|
118 |
fields['link_id'] = fields['link_id'].link_id |
575 | 119 |
|
662
0e89b027b140
Make use of the new generic key_name by lookup up scope_path
Sverre Rabbelier <srabbelier@gmail.com>
parents:
657
diff
changeset
|
120 |
super(View, self)._editPost(request, entity, fields) |
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
121 |
|
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
122 |
def _acceptInvitePost(self, fields, request, context, params, **kwargs): |
959
b6e8750c9407
Some style guide fixes, docstring fixes and removal of unused imports in different modules. Rename acceptInvite view variable to accept_invite in soc.views.models.host module to comply to our style guide.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
944
diff
changeset
|
123 |
"""Fills in the fields that were missing in the invited_created_form. |
944
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
124 |
|
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
125 |
For params see base.View._acceptInvitePost() |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
126 |
""" |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
127 |
# fill in the appropriate fields that were missing in the form |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
128 |
fields['user'] = fields['link_id'] |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
129 |
fields['link_id'] = fields['link_id'].link_id |
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
130 |
|
5ea2bd9e3fa6
Refactored invite system from club_admin to role to make the system work with host as well.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
920
diff
changeset
|
131 |
|
400
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
132 |
view = View() |
8f07048d84ef
Added a generic version of the Document views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
133 |
|
1584
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
134 |
accept_invite = decorators.view(view.acceptInvite) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
135 |
admin = decorators.view(view.admin) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
136 |
create = decorators.view(view.create) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
137 |
delete = decorators.view(view.delete) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
138 |
edit = decorators.view(view.edit) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
139 |
invite = decorators.view(view.invite) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
140 |
list = decorators.view(view.list) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
141 |
manage = decorators.view(view.manage) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
142 |
process_request = decorators.view(view.processRequest) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
143 |
public = decorators.view(view.public) |
d8ba8c917f37
Make use of decorators.view for all views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1583
diff
changeset
|
144 |
export = decorators.view(view.export) |