Revision dc946891 snf-astakos-app/astakos/im/tables.py

b/snf-astakos-app/astakos/im/tables.py
207 207
    membership = user.get_membership(project)
208 208
    if membership is not None:
209 209
        if can_leave and membership.can_leave():
210
            url = 'astakos.im.views.project_leave'
210
            url = reverse('astakos.im.views.project_leave',
211
                          args=(membership.id,))
211 212
            action = _('Leave')
212 213
            confirm = True
213 214
            prompt = _('Are you sure you want to leave from the project?')
214 215
        elif can_cancel and membership.can_cancel():
215
            url = 'astakos.im.views.project_cancel'
216
            url = reverse('astakos.im.views.project_cancel_member',
217
                          args=(membership.id,))
216 218
            action = _('Cancel')
217 219
            confirm = True
218 220
            prompt = _('Are you sure you want to cancel the join request?')
219 221

  
220 222
    elif can_join:
221
        url = 'astakos.im.views.project_join'
223
        url = reverse('astakos.im.views.project_join', args=(project.id,))
222 224
        action = _('Join')
223 225
        confirm = True
224 226
        prompt = _('Are you sure you want to join this project?')
......
227 229
        confirm = False
228 230
        url = None
229 231

  
230
    url = reverse(url, args=(project.id, )) + append_url if url else ''
231

  
232 232
    return {'action': action,
233 233
            'confirm': confirm,
234 234
            'url': url,
......
351 351
        confirms = [True, True]
352 352

  
353 353
    for i, url in enumerate(urls):
354
        context.append(dict(url=reverse(url, args=(table.project.pk,
355
                                                   membership.pk)),
354
        context.append(dict(url=reverse(url, args=(membership.pk,)),
356 355
                            action=actions[i], prompt=prompts[i],
357 356
                            confirm=confirms[i]))
358 357
    return context

Also available in: Unified diff