Consistant error for groups that dont exist in API
This commit is contained in:
parent
b7a08fdacc
commit
e14c88f6c5
@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
|
||||
}
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError('Group not found!', 404, $this->format);
|
||||
$this->clientError(_('Group not found!'), 404, $this->format);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction
|
||||
}
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError('Group not found!', 404, $this->format);
|
||||
$this->clientError(_('Group not found!'), 404, $this->format);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction
|
||||
}
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError('Group not found!', 404, $this->format);
|
||||
$this->clientError(_('Group not found!'), 404, $this->format);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,11 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
|
||||
{
|
||||
parent::handle($args);
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError(_('Group not found!'), 404, $this->format);
|
||||
return false;
|
||||
}
|
||||
|
||||
// XXX: RSS and Atom
|
||||
|
||||
switch($this->format) {
|
||||
|
@ -87,7 +87,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError(
|
||||
'Group not found!',
|
||||
_('Group not found!'),
|
||||
404,
|
||||
$this->format
|
||||
);
|
||||
|
@ -69,7 +69,6 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
|
||||
parent::prepare($args);
|
||||
|
||||
$this->group = $this->getTargetGroup($this->arg('id'));
|
||||
$this->notices = $this->getNotices();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -87,6 +86,13 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
|
||||
function handle($args)
|
||||
{
|
||||
parent::handle($args);
|
||||
|
||||
if (empty($this->group)) {
|
||||
$this->clientError(_('Group not found!'), 404, $this->format);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->notices = $this->getNotices();
|
||||
$this->showTimeline();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user